Closed johanandren closed 12 months ago
Possibly also the offset store which follows that same pattern of injecting a Receiver
The run function doesn’t return until completion. You also want these channels passed in, particularly the command channel. There are a variety of other tasks that commonly want to send commands to the entity and therefore need the sender.
Actually, we could offer conveniences that would create the channels and return a sender and a task to then be spawned by the user… I could try that, with the existing public API still be offered for other use cases.
Could it make sense to return a
Sender<Message<...>>
fromentity_manager::run
instead of()
like now, instead of the user having to create the sender/receiver?When setting the entity up you'd always want that sender, so it will be repeated logic for each entity just to be able to set the buffer size (which we could take as a parameter to
run
).