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.
Most
build-topology(or equivalent) functions look very similar. In simple cases something like a macro forcould 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-topologymacro that bound e.g.*trident-topology*to aTridentTopologyobject, 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 awith-trident-topology. I think that's fine.