Spawning Isolates and Message Passing
Communicate through SendPort and ReceivePort.
Going Manual
For long-lived, chatty workers you spawn an isolate yourself with Isolate.spawn. You stay in control of its whole lifetime.
The Entry Point
Isolate.spawn needs a top-level function as its entry point, plus one argument to send it at startup.
Isolate.spawn(worker, message);All lessons in this course
- Why Isolates, Not Threads
- Isolate.run for Quick Offloading
- Spawning Isolates and Message Passing
- Compute-Heavy Tasks Without Jank