Created
July 31, 2016 18:15
-
-
Save ufobat/9da94ef6d12f56a6f7b59804888d5237 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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