Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an execution context to GraphMethod execute() method #128

Open
augustearth opened this issue Apr 19, 2024 · 0 comments
Open

Add an execution context to GraphMethod execute() method #128

augustearth opened this issue Apr 19, 2024 · 0 comments

Comments

@augustearth
Copy link
Collaborator

The method that graph methods currently have to implement is:

abstract void execute(Graph graph, GraphTraversalSource g) 

This means that the execute method has access to the graph, but no other context for the execution including the process vertex that was created. To make it easier for the execute method to attach graph elements to the process vertex, we need to supply a pointer to it. The process vertex is currently available to the graph method as a protected field, which works, but also makes the GraphMethod object not thread-safe. The processVertex is set at the start of the execution. If execution is called again while the first is still running, then processVertex will be overwritten with the one created for the second call.

Create an ExecutionContext that will be passed to execute. Not sure if we should add a parameter or put the Graph and GraphTraversalSource in the context...

abstract void execute(Graph graph, GraphTraversalSource g, ExecutionContext ctx) 

or

abstract void execute(ExecutionContext ctx) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant