question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Messages based on Commands are not fed into stream

See original GitHub issue

Hey 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:open
  • Created 4 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
dbrattlicommented, Jun 26, 2019

Yes, I get the point. I’ll look into it.

1reaction
johanneseggercommented, Aug 31, 2019

@bender2k14 not directly. With streams I don’t use Cmds at all. update has the signature 'msg -> 'model -> 'model instead of 'msg -> 'model -> 'model * Cmd<'msg>. The side effects that are usually performed by Cmds 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 Cmds but built into streams).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found