pub async fn run<A, B>(
    behavior: B,
    adapter: A,
    receiver: Receiver<Message<B::Command>>,
    capacity: NonZeroUsize
) -> Result<()>where
    B: EventSourcedBehavior + Send + Sync + 'static,
    B::Command: Send,
    B::State: Send + Sync,
    A: SourceProvider<B::Event> + Handler<B::Event> + Send + 'static,
Expand description

Manages the lifecycle of entities given a specific behavior. Entity managers are established given a source of events associated with an entity type. That source is consumed by subsequently telling the entity manager to run, generally on its own task.

Commands are sent to a channel established for the entity manager. Effects may be produced as a result of performing a command, which may, in turn, perform side effects and yield events.