MultiHandler<M, A> class
GroupStrategy that sends each message received to handlersPerMessage
(m) Messengers, and requires 'minAnswers' (n) successful answers to
provide a final, combined answer, where group size >= m >= n
.
The handlers for each message are currently chosen randomly from the available group's messengers each time a message is sent, but this behaviour may change in the future.
- Inheritance
-
- Object
- GroupStrategy<
M, A> - MultiHandler
Constructors
-
MultiHandler({int minAnswers = 2, int? handlersPerMessage, A combineAnswers(List<
A> )?}) - Creates a MultiHandler with:
Properties
-
combineAnswers
→ A Function(List<
A> ) -
final
- handlersPerMessage → int?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- minAnswers → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toHandler(
List< Messenger< messengers) → HandlerFunction<M, A> >M, A> -
Get a HandlerFunction that uses this strategy to forward messages
to the provided
messengers
, returning a single answer that may be either provided by one of the given messengers, or computed by combining in some way the answers given by the messengers.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited