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

Decouple node and edge creation #56

Closed
CJ-Wright opened this issue Aug 17, 2017 · 7 comments
Closed

Decouple node and edge creation #56

CJ-Wright opened this issue Aug 17, 2017 · 7 comments

Comments

@CJ-Wright
Copy link
Member

Would it be possible/desirable to separate node and edge creation?

When we create a streamz pipeline we are creating a directed task graph. Currently this is done by creating nodes and simultaneously attaching them to other nodes (creating an edge). However, we may run into the situation where we want a bunch of nodes sitting in a library waiting to be used. This way users could mix and match how their nodes connected, essentially adding edges after the nodes were imported.

@mrocklin
Copy link
Collaborator

mrocklin commented Aug 17, 2017 via email

@CJ-Wright
Copy link
Member Author

I create a few nodes which map some function onto the data. Then I'd like to write 5 pipelines which use these nodes in different positions in the execution. Currently I'd need to duplicate the code for those nodes 5 times, since their upstream nodes would be different and that is bound at instantiation. With nodes created without a graph I could just import the nodes into the 5 pipelines and just plumb them together.

@mrocklin
Copy link
Collaborator

mrocklin commented Aug 17, 2017 via email

@CJ-Wright
Copy link
Member Author

Maybe. That would only happen if I was running all the pipelines at once. One could run a deep copy on the node to make copies?

@mrocklin
Copy link
Collaborator

Is it costly to make a new node each time as is currently done? What are the advantages of pre-instantiating these objects ahead of time rather than creating them on the fly? So far in my toy examples I've only run into cases where recreating every time was free.

@jrmlhermitte
Copy link
Contributor

how does this differ from connect?
(#45)

@CJ-Wright
Copy link
Member Author

Connect may have solved this issue, we just need to have a unique source for every incoming node to connect to.

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

3 participants