Good day.

I would like to propose using the service as a foundation for listeners of
the Graph life cycle events.

It can look like the following:
1. User creates a service using the provided WASM byte code using a special
step like registerService(name, wasmByteCode).
2. User registers the service as a listener for graph events. I think that
could be events like vertex, edge lifecycle events, TX commit again using
GraphTraversal commands.
3. During the generation of the event, a special traversal that contains
only the affected elements is created, and the service is called upon it.
Like `_.inject(elements).call()`.

In practice, it is advised for each GLV to provide a specialized
implementation of `registerService()` step that will compile the passed-in
code into the WASM if possible.
That is possible on Java, and I suppose it is possible for JavaScript at
least.

That will allow us to blur the difference between remote and embedded
deployments, and for vendors that provide both variants to provide
debugging tools for lifecycle listeners when users can test and debug
implementation on their workstation and then deploy in production.

WASM bytecode was intentionally designed for such use cases. I would be
interested in opinions about this proposal, which is, of course, subject to
a separate specification and many additional clarifications.

Reply via email to