WalletCoordinator class

The coordinator, as an application talks to it: send a command and wait for its own answer (ask), send one and leave the answer on the event stream (tell), or follow the events of one kind (on).

final invoice = await libspiffy.coordinator
    .ask(CreateInvoiceCommand(walletId: 'bob', amount: BigInt.from(1000)));
libspiffy.coordinator.on<BalanceUpdatedEvent>(walletId: 'bob').listen(render);

Constructors

WalletCoordinator(ActorRef _ref, WalletCoordinatorActor _actor)

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

ask<R extends CoordinatorReply>(CoordinatorRequest<R> request, {Duration? timeout}) → Future<R>
Sends request and completes with its reply.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on<E extends CoordinatorEvent>({String? walletId}) → Stream<E>
The events of type E, of wallet walletId when given.
tell(Message command) → void
Sends command. Its answer, if it has one, arrives on the event stream.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited