tribbles 0.1.0 copy "tribbles: ^0.1.0" to clipboard
tribbles: ^0.1.0 copied to clipboard

outdated

A Dart library to assist working with large numbers of Isolates.

example/tribbles_example.dart

import 'dart:io';

import 'package:tribbles/tribbles.dart';

void hi(m) {
  print('hi from Tribble worker');
  Tribble.connect(m).listen((message) {
    print('[Tribble received] $message');

    Tribble.reply(m, 'I got your message!');
  });
}

void main() async {
  final tribble = Tribble(hi);

  tribble.messages.listen((event) {
    print('[mesg from Tribble] $event');
  });

  print('created your first tribble ${tribble}');

  // wait for tribble to be ready
  await tribble.alive;

  tribble.sendMessage('do something tribble');
  await Future.delayed(Duration(milliseconds: 50));
  print('good bye tribble');
  tribble.kill();
  exit(0);
}
1
likes
0
points
37
downloads

Publisher

verified publishermanichord.com

Weekly Downloads

A Dart library to assist working with large numbers of Isolates.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on tribbles