Skip to content

Instantly share code, notes, and snippets.

@ufobat
Created July 31, 2016 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ufobat/9da94ef6d12f56a6f7b59804888d5237 to your computer and use it in GitHub Desktop.
Save ufobat/9da94ef6d12f56a6f7b59804888d5237 to your computer and use it in GitHub Desktop.
my $supplier = Supplier.new;
my $supply = $supplier.Supply;
my $buff;
$supply.tap(-> $v {say "recv: $v"; $buff ~= $v}, done => sub {"supply done"});
$supplier.emit(1);
$supplier.emit(2);
$supplier.emit(3);
$supplier.done();
say "buff: $buff";
$supply.wait();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment