Additional samples for Concurrency in Dart.
bin/send_and_receive.dart
: Demonstrates how to spawn anIsolate
and send it initial input usingIsolate.spawn
. The spawned isolate is shortlived and returns its result to the main isolate usingIsolate.exit
, which is fast.bin/long_running_isolate.dart
: Similar tosend_and_receive.dart
, except that the spawned isolate is long running, responds to incoming messages from the main isolate, and sends responses until it receives anull
over itsSendPort
.