ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.pm
(Generate patch)

Comparing IO-AIO/AIO.pm (file contents):
Revision 1.190 by root, Thu May 19 22:42:20 2011 UTC vs.
Revision 1.192 by root, Fri May 20 00:00:03 2011 UTC

1406 1406
1407See C<poll_cb> for an example. 1407See C<poll_cb> for an example.
1408 1408
1409=item IO::AIO::poll_cb 1409=item IO::AIO::poll_cb
1410 1410
1411Process some outstanding events on the result pipe. You have to call this 1411Process some outstanding events on the result pipe. You have to call
1412regularly. Returns C<0> if all events could be processed, or C<-1> if it 1412this regularly. Returns C<0> if all events could be processed (or there
1413returned earlier for whatever reason. Returns immediately when no events 1413were no events to process), or C<-1> if it returned earlier for whatever
1414are outstanding. The amount of events processed depends on the settings of 1414reason. Returns immediately when no events are outstanding. The amount of
1415C<IO::AIO::max_poll_req> and C<IO::AIO::max_poll_time>. 1415events processed depends on the settings of C<IO::AIO::max_poll_req> and
1416C<IO::AIO::max_poll_time>.
1416 1417
1417If not all requests were processed for whatever reason, the filehandle 1418If not all requests were processed for whatever reason, the filehandle
1418will still be ready when C<poll_cb> returns, so normally you don't have to 1419will still be ready when C<poll_cb> returns, so normally you don't have to
1419do anything special to have it called later. 1420do anything special to have it called later.
1421
1422Apart from calling C<IO::AIO::poll_cb> when the event filehandle becomes
1423ready, it can be beneficial to call this function from loops which submit
1424a lot of requests, to make sure the results get processed when they become
1425available and not just when the loop is finished and the event loop takes
1426over again. This function returns very fast when there are no outstanding
1427requests.
1420 1428
1421Example: Install an Event watcher that automatically calls 1429Example: Install an Event watcher that automatically calls
1422IO::AIO::poll_cb with high priority (more examples can be found in the 1430IO::AIO::poll_cb with high priority (more examples can be found in the
1423SYNOPSIS section, at the top of this document): 1431SYNOPSIS section, at the top of this document):
1424 1432

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines