akka / akka-edge-rs

Akka Edge support in Rust
https://doc.akka.io/docs/akka-edge/current/
Other
9 stars 1 forks source link

Return the channel from the entity manager #116

Closed johanandren closed 12 months ago

johanandren commented 12 months ago

Could it make sense to return a Sender<Message<...>> from entity_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).

johanandren commented 12 months ago

Possibly also the offset store which follows that same pattern of injecting a Receiver

huntc commented 12 months ago

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.