ryrobes / flowmaps

Construct & orchestrate stand-alone Clojure core.async pipelines with ease or use it to encapsulate & manage complex 'flows' within your application
Eclipse Public License 2.0
115 stars 7 forks source link

fns allowed as the head of a flow? #3

Open gjw opened 4 months ago

gjw commented 4 months ago

I'm probably just missing something, but it seems that all heads (sources) of a flow have to be static data?

Assume I have 2 heads in a flow: url and current-timestamp, and a single sink where they get mangled and printed. I can put a dummy block with static data as the head before the timestamp to kick it off, but that's just a goofy workaround.

It makes sense, being reactive, that something needs to trigger current-timestamp, or it just fires never, or randomly.

It kind of makes sense to have the flow url -> timestamp -> output, except then you have to change the signature for timestamp to accept nonsense and pass the original data back out.

I guess you could

:connections {:url :output 
              :url  :timestamp
              :timestamp :output
              :output :done}

Then the only weirdness is the modified signature for timestamp. What's the suggested pattern here?

gjw commented 4 months ago

I think I just want to differentiate, logically and visually, between 'B is invoked when A completes' and 'B is invoked with A's output'