Created
May 19, 2011 16:58
-
-
Save miyagawa/981223 to your computer and use it in GitHub Desktop.
http://dis.4chan.org/read/prog/1295544154 http://blogs.perl.org/users/rocco_caputo/2011/05/sleep-sort-with-poe.html
This file contains hidden or 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
#!perl | |
use v5.10; | |
use AnyEvent; | |
my $cv = AE::cv; | |
my @timers; | |
for my $num (@ARGV) { | |
$cv->begin; | |
push @timers, AE::timer $_, 0, sub { | |
say $num; | |
$cv->end; | |
} | |
} | |
$cv->recv; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment