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

Remove config method from VertexSpec #65

Closed
moaxcp opened this issue Apr 25, 2017 · 0 comments
Closed

Remove config method from VertexSpec #65

moaxcp opened this issue Apr 25, 2017 · 0 comments

Comments

@moaxcp
Copy link
Owner

moaxcp commented Apr 25, 2017

Creating a vertex is still a pain. It is hard to understand what should go into the config closure and how it relates to what happens outside of the config closure. The vertex closure needs to be streamlined so config traits can be setup and the graph can be setup while the closure is running.

VertexSpec

The config closure will be renamed to runnerCode. It will contain the closure passed to vertex methods.

vertex methods

All methods will create a VertexSpec and pass it to the vertex(VertexSpec) method

vertex(String)
vertex(String, Map)
vertex(String, Map, Closure)
vertex(String, Closure)
vertex(VertexSpec)

VertexSpecRunner in vertex(VertexSpec)

A new object that will run VertexSpec.runnerCode. It will perform all statements in the closure on the graph, and vertex. It will control new methods that are available to the closure.

This is an example of what should be able to happen in the closure.

vertex step1 {
    traits Mapping
    key = 'value'
    traits Weight
    weight 20
}

vertex step2(traits:Mapping) {
    key = 'value'
    traits Weight
    weight 30
    edgesFirst 'step1'
    println adjacentEdges(name)
}

This allows traits to be applied and code to execute against the trait once it is added.

@moaxcp moaxcp closed this as completed in 7fddead May 5, 2017
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