See /examples in the distribution for a fleshed-out demonstration.
This is “the hard way” to do this, by the way. Your life will be simpler if you use (or create) an event-loop-based implementation like Net::Curl::Promiser::AnyEvent or Net::Curl::Promiser::IOAsync. See /examples for comparisons.
The following are added in addition to the base class methods:
Returns the bitmasks to use as input to
Note that, since these are copies of OBJ’s internal values, you don’t need to copy them again before calling
Returns the file descriptors that OBJ tracks—or, in scalar context, the count of such. Useful to check for exception events.
Tell the underlying Net::Curl::Multi object which socket events have happened. $READ_MASK and $WRITE_MASK are as “left” by Perl’s
If, in fact, no events have happened, then this calls
socket_action(CURL_SOCKET_TIMEOUT) on the Net::Curl::Multi object (similar to
Finally, this reaps whatever pending HTTP responses may be ready and resolves or rejects the corresponding Promise objects.
Tell the underlying Net::Curl::Multi object that a timeout happened, and reap whatever pending HTTP responses may be ready.
socket_action(CURL_SOCKET_TIMEOUT) on the underlying Net::Curl::Multi object. The return is the same as that operation returns.
process() can also do the work of this function, a call to this function is just an optimization.
This should only be called from event loop logic.
Like libcurl’s curl_multi_timeout(3), but sometimes returns different values depending on the needs of OBJ.
(NB: This value is in seconds, not milliseconds.)
This should only be called (if it’s called at all) from event loop logic.