startIsolateLoop method
void
startIsolateLoop(})
Starts a sequential loop in a separate isolate.
Constraint: The body must be a top-level function or a static method.
Closures that capture state cannot be sent across isolate boundaries.
Implementation
void startIsolateLoop(
String id,
FutureOr<void> Function() body, {
Duration? delay,
String? debugName,
bool permanent = false,
}) {
final service =
_IsolateLoopService(body, delay: delay, debugName: debugName);
registerService(id, service, permanent: permanent);
service.start();
}