If you use this code within your outer loop (the one with $cv->begin...$cv->end, then I think you're calling $cv->end too early and you never ->recv the guards, so I'm not sure that you ever enter the AnyEvent event loop...
I think the intended usage of $cv->begin ...$cv->end is that the ->end call happens within the callback, not within the loop body:
my $all_requests_done = AnyEvent->condvar; for my $r (@requests) { $all_requests_done->begin(); http_post $r, sub { ... $all_requests_done->end(); }; }; $all_requests_done->recv;
Can you try to do a simple, self-contained program that does a single HTTP POST request and waits for it, without the ->begin ... ->end stuff?
Update: (After two reboots due to power loss) added intended usage of ->begin ... ->end
In reply to Re^4: AnyEvent::HTTP and getting data back from a post request
by Corion
in thread AnyEvent::HTTP and getting data back from a post request
by kiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |