… | |
… | |
745 | This works because for every event source (EOF on file handle), there is |
745 | This works because for every event source (EOF on file handle), there is |
746 | one call to C<begin>, so the condvar waits for all calls to C<end> before |
746 | one call to C<begin>, so the condvar waits for all calls to C<end> before |
747 | sending. |
747 | sending. |
748 | |
748 | |
749 | The ping example mentioned above is slightly more complicated, as the |
749 | The ping example mentioned above is slightly more complicated, as the |
750 | there are results to be passwd back, and the number of tasks that are |
750 | there are results to be passed back, and the number of tasks that are |
751 | begun can potentially be zero: |
751 | begun can potentially be zero: |
752 | |
752 | |
753 | my $cv = AnyEvent->condvar; |
753 | my $cv = AnyEvent->condvar; |
754 | |
754 | |
755 | my %result; |
755 | my %result; |