austinjones / lifeline-rs

A dependency injection library for message-based applications
MIT License
38 stars 3 forks source link

Add `Task::spawn_many` and `Task::try_spawn_many` #32

Open austinjones opened 4 years ago

austinjones commented 4 years ago

If one of the inputs to Task::spawn was &Bus, lifeline could create and execute a group of message receivers, not just one.

Lifeline would take the bus, and a FnMut spawn function which receives &Bus and returns a Future. That would pull channels off the bus using rx::()?.

spawn_many would take a core size, and a max size. If the core size could not be fulfilled, the spawn would fail.

austinjones commented 4 years ago

This is interesting. Multiple tasks will need to share a lifeline value.