nevalang / neva

🌊 Dataflow programming language with static types and implicit parallelism. Compiles to native code and Go
https://nevalang.org
MIT License
86 stars 7 forks source link

Non-blocking `For` #690

Open emil14 opened 5 days ago

emil14 commented 5 days ago

For now blocks until all stream elements are processed and then sends a signal - original stream is lost. It's possible to see a different semantics:

  1. For emits stream (sends original downstream) instead of blocking and sending signal
  2. New Wait component is introduced and used for one purpose - block until end of stream

... -> for -> wait -> :stop

emil14 commented 5 days ago

I can see benefit in theory. Example: ... -> for -> map -> .... E.g. save every element and mark it as is_saved: true

Much easier than create branching in topology. Also better performance