registerWithParent method
- @mustCallSuper
- TypedSendPort<
ChildIsolatePayload< portLlamaResponse, LlamaCommand> >
inherited
Registers this child with its parent.
This function is critical for establishing commmunication and should not be modified. If you
need to run code when the isolate is spawned, prefer to override onSpawn instead. If you must
override this, be sure to call super.registerWithParent() first.
Implementation
@mustCallSuper
Future<void> registerWithParent(
TypedSendPort<ChildIsolatePayload<S, R>> port,
) async {
_receiver = TypedReceivePort<R>(ReceivePort());
_sender = port;
_sender.send(
ChildIsolateRegistration<S, R>(
id: id,
port: _receiver.sendPort,
),
);
await onSpawn();
_receiver.stream.listen(onData);
}