Was implementing reactive streams for Lispz worth the effort? Let’s see where we stand. Let’s consider the example from the last blog post.
If we did not have message streams, the code would look something like:
Well, I guess that answers that. Reactive streams are a lot more readable than in-line code. In addition you are not rewriting throttle every time you need it.
Perhaps I should have asked the question “When don’t we use Reactive Streams for asynchronous events“.
- When a promise will do – so any server request that does not need to send a message.
- When a stream will have more than one source, or wait on a promise. The current architecture doesn’t merge asynchronous events (yet).
Ok, that is a shorter list thank I expected. Can you think of others? It seems to me that streams work well for continuous discrete data flows from callbacks and events.