… | |
… | |
94 | # in the hope of not colliding. yes, I don't like it either, |
94 | # in the hope of not colliding. yes, I don't like it either, |
95 | # but didn't come up with an obviously better alternative. |
95 | # but didn't come up with an obviously better alternative. |
96 | my $magic0 = ':t6Z@HK1N%Dx@_7?=~-7NQgWDdAs6a,jFN=wLO0*jD*1%P'; |
96 | my $magic0 = ':t6Z@HK1N%Dx@_7?=~-7NQgWDdAs6a,jFN=wLO0*jD*1%P'; |
97 | my $magic1 = '<~53rexz.U`!]X[A235^"fyEoiTF\T~oH1l/N6+Djep9b~bI9`\1x%B~vWO1q*'; |
97 | my $magic1 = '<~53rexz.U`!]X[A235^"fyEoiTF\T~oH1l/N6+Djep9b~bI9`\1x%B~vWO1q*'; |
98 | |
98 | |
99 | our $VERSION = 1.1; |
99 | our $VERSION = 1.2; |
100 | |
100 | |
101 | =item my $pool = AnyEvent::Fork::Pool::run $fork, $function, [key => value...] |
101 | =item my $pool = AnyEvent::Fork::Pool::run $fork, $function, [key => value...] |
102 | |
102 | |
103 | The traditional way to call the pool creation function. But it is way |
103 | The traditional way to call the pool creation function. But it is way |
104 | cooler to call it in the following way: |
104 | cooler to call it in the following way: |
… | |
… | |
397 | |
397 | |
398 | last; |
398 | last; |
399 | } |
399 | } |
400 | } |
400 | } |
401 | } elsif ($shutdown) { |
401 | } elsif ($shutdown) { |
402 | @pool = (); |
402 | undef $_->[2] |
|
|
403 | for @pool; |
|
|
404 | |
403 | undef $start_w; |
405 | undef $start_w; |
404 | undef $start_worker; # frees $destroy_guard reference |
406 | undef $start_worker; # frees $destroy_guard reference |
405 | |
407 | |
406 | $stop_worker->($pool[0]) |
408 | $stop_worker->($pool[0]) |
407 | while $nidle; |
409 | while $nidle; |