Created
May 28, 2013 09:04
-
-
Save berekuk/5661492 to your computer and use it in GitHub Desktop.
Coro vs Dancer issue - see https://github.com/PerlDancer/Dancer/issues/929
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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Coro; | |
| use Coro::AnyEvent; | |
| my $param; | |
| sub param { | |
| return $param; | |
| } | |
| sub route { | |
| Coro::AnyEvent::sleep 1; | |
| print param, "\n"; | |
| } | |
| sub req { | |
| my ($arg) = @_; | |
| return async { | |
| $param = $arg; | |
| route; | |
| }; | |
| } | |
| my @c = map { req("foo$_") } (1..5); | |
| $_->join for @c; |
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
| foo5 | |
| foo5 | |
| foo5 | |
| foo5 | |
| foo5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment