actors 0.2.0 copy "actors: ^0.2.0" to clipboard
actors: ^0.2.0 copied to clipboard

outdated

Actors Model library for Dart. It is a thin wrapper around Dart's `Isolate` that makes them much easier to use.

example/actors_example.dart

import 'dart:io' show exit;
import 'dart:isolate' show Isolate;

import 'package:actors/actors.dart';

class Two with Handler<int, int> {
  int handle(int n) => n * 2;
}

main() async {
  final actor = Actor(Two());
  print(await actor.send(5)); // 10
  print(await actor.send(6)); // 12
  print(await actor.send(7)); // 14
  print(await actor.send(8)); // 16

  final isolate = await actor.isolate;
  isolate.kill(priority: Isolate.immediate);

  exit(0);
}
26
likes
0
pub points
75%
popularity

Publisher

unverified uploader

Actors Model library for Dart. It is a thin wrapper around Dart's `Isolate` that makes them much easier to use.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on actors