Messages based on Commands are not fed into stream
See original GitHub issueHey Dag,
I am trying to use Elmish Stream in the Safe Confplanner and I am banging my head for the last couple of hours because it is not working as (I) expected.
In the Confplanner I need to work with commands (so no mksimple) and I have a couple of situations where I need to create messages from commands within the update function. For this I am using the elmish Cmd.OfFunc.result MyMsg
et al functions. It seems that those message are never fed into the message stream (it is somehow circumvented and the messages go directly into update). Is this expected behaviour? I can create a minimal repro but I wanted check first if this is the way it is supposed to be.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
My python based discord bot is not responding to any ...
My python based discord bot is not responding to any commands entered, and the initial method is not printing anything - Stack Overflow....
Read more >Custom Commands Webhook - React chat
By using Custom Commands, you can receive all messages sent using a specific slash command, eg. /ticket , in your application. When configured,...
Read more >Redis Streams
In summary, Redis Streams is an exciting new feature to build history preserving message brokers, message queues, unified logs, and chat systems. Interacting ......
Read more >Streams Concepts
Some stream processing applications don't require state – they are stateless – which means the processing of a message is independent from the...
Read more >What is Pub/Sub?
Understand how Pub/Sub works and the different terms associated with Pub/Sub.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I get the point. I’ll look into it.
@bender2k14 not directly. With streams I don’t use
Cmd
s at all.update
has the signature'msg -> 'model -> 'model
instead of'msg -> 'model -> 'model * Cmd<'msg>
. The side effects that are usually performed byCmd
s are now performed as part of the stream. Mocking those side effects - e.g. in tests - might become harder but I consider those tests to be too trivial to create anyway (probably an unpopular opinion).I found that the coupling between a state update and deciding what side-effect to perform sometimes makes things unnecessarily complicated (e.g. throttling/debouncing is not trivial with
Cmd
s but built into streams).