runProtocol method

void runProtocol(
  1. ActorContext ctx,
  2. Protocol protocolBuilder(
    1. ProtocolBuilderInit builder
    )
)

Create a new instance of a protocol and run it.

Implementation

void runProtocol(
  ActorContext ctx,
  Protocol Function(ProtocolBuilderInit builder) protocolBuilder,
) async {
  final uuid = _uuid.v4();
  final builder = ProtocolBuilderInit();
  final protocol = protocolBuilder(builder);
  _pendingProtocols[uuid] = protocol;
  await protocol._init!(ctx, uuid);
}