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

some sort of macro for defining topologies #1

Open
strongh opened this issue Oct 29, 2013 · 4 comments
Open

some sort of macro for defining topologies #1

strongh opened this issue Oct 29, 2013 · 4 comments

Comments

@strongh
Copy link
Contributor

strongh commented Oct 29, 2013

Most build-topology (or equivalent) functions look very similar. In simple cases something like a macro for

(doto (TridentTopology.)
   (t/new-stream "my-spout" spout)
   ...))

could almost work. But for even marginally more complicated topologies, there might be states or intermediate streams that need to be defined.

Another option would be to have a with-trident-topology macro that bound e.g. *trident-topology* to a TridentTopology object, and returned the trident topology at the end. We'd have to change all the arities of the existing helpers, and they would no longer be useful outside of a with-trident-topology. I think that's fine.

@sorenmacbeth
Copy link
Owner

One way to deal with the arity issue would be to make the functions suffixed by * again, then have macro version without the * for use in the with-trident-topology macro.

@strongh
Copy link
Contributor Author

strongh commented Oct 29, 2013

I like that idea. Consistent with the current use of the * suffix as "stuff to be used inside macros".

@strongh
Copy link
Contributor Author

strongh commented Oct 30, 2013

Another possibility is to have a deftridenttopology which would replace build-topology fns. The question there is what the signature should be - a seq of spouts, a seq of state factories, and a drpc, all optional? This wouldn't exclude with-trident-topology, it would probably use it. Basically deftridenttopology would just wrap with-trident-topology with a standard signature.

@strongh
Copy link
Contributor Author

strongh commented Oct 31, 2013

Also we probably want something related for streams, e.g. defstream, with-stream, etc.

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

2 participants