nevalang/neva

Non-blocking `For`

emil14 opened this issue · 2 comments

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

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