onSpawn method

  1. @override
Future<void> onSpawn()
override

Runs when the child isolate is spawned, after registerWithParent is called.

Note that onData will not be called until this function has finished executing. if you need to execute lots of code here, you should split it into two parts, the parts that need to run before any messages can be handled, and parts that can run after/while messages are being handled, then use await for the first parts and unawaited for the second.

Implementation

@override
Future<void> onSpawn() async {
  sendLog(LogLevel.debug, "Initializing camera: $name");
  statusTimer = Timer.periodic(const Duration(seconds: 5), sendStatus);
  start();
}