ActorGroup<M, A>.create constructor

ActorGroup<M, A>.create(
  1. Handler<M, A> createHandler(), {
  2. int size = 6,
  3. GroupStrategy<M, A>? strategy,
})

Creates an ActorGroup with the given size that handles messages using the given Handler.

A GroupStrategy may be provided, defaulting to RoundRobin.

Use the of constructor to wrap a function directly.

Implementation

ActorGroup.create(Handler<M, A> Function() createHandler,
    {this.size = 6, GroupStrategy<M, A>? strategy})
    : _group = _Group(
          _buildActors(size, createHandler), strategy ?? RoundRobin<M, A>());