I have the problem that i need to request data from an HTTPS API that can take a minute or two to return. I'm currently using LWP::UserAgent. This blocks my worker script (cyclic executive).
Is there any non-blocking way (or module) to run those requests without forking? E.g., start the request and poll in my worker loop? I have a lot of open file and network handles which i don't want to mess up by forking.
I was thinking along the lines of this pseudo-code:
my $bla = Some::Module->new(); $bla->get("https://example.com/api1?bli=blub"); while(1) { ... if($bla->finished) { my $result = $bla->getResult(); ... # Start next request ... }
In reply to LWP::UserAgent non-blocking calls by cavac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |