Skip to content

CommandContext does not wake a pending Command stream. #441

Description

@DeltaEvo

If a Command is returned as part of update but its CommandContext is used from another Command (for example by sending the CommandContext in an Event). Sending an Event or an Effect on the CommandContext will do nothing as the Command Stream waker by never be signaled.

(I plan to write a test exercising this to make this clearer).

This is due to the CommandContext using non async-aware channels (crossbeam ones) without manual waker handling code.

I tried updating the CommandContext to use a channel from futures, without success, as I'm missing a way to implement is_empty (used in done).

Another solution could be to share the waker from Command to CommandContext, but this would maybe break the automatic task cancellation when there is no waker left.

One last solution but seems a little hacky, would be to have another AtomicWaker just for the CommandContext :/

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions