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.239 by root, Thu Dec 13 02:26:28 2012 UTC vs.
Revision 1.240 by root, Mon Dec 17 06:18:39 2012 UTC

1759 1759
1760See C<poll_cb> for an example. 1760See C<poll_cb> for an example.
1761 1761
1762=item IO::AIO::poll_cb 1762=item IO::AIO::poll_cb
1763 1763
1764Process some outstanding events on the result pipe. You have to call 1764Process some requests that have reached the result phase (i.e. they have
1765been executed but the results are not yet reported). You have to call
1766this "regularly" to finish outstanding requests.
1767
1765this regularly. Returns C<0> if all events could be processed (or there 1768Returns C<0> if all events could be processed (or there were no
1766were no events to process), or C<-1> if it returned earlier for whatever 1769events to process), or C<-1> if it returned earlier for whatever
1767reason. Returns immediately when no events are outstanding. The amount of 1770reason. Returns immediately when no events are outstanding. The amount
1768events processed depends on the settings of C<IO::AIO::max_poll_req> and 1771of events processed depends on the settings of C<IO::AIO::max_poll_req>,
1769C<IO::AIO::max_poll_time>. 1772C<IO::AIO::max_poll_time> and C<IO::AIO::max_outstanding>.
1770 1773
1771If not all requests were processed for whatever reason, the filehandle 1774If not all requests were processed for whatever reason, the poll file
1772will still be ready when C<poll_cb> returns, so normally you don't have to 1775descriptor will still be ready when C<poll_cb> returns, so normally you
1773do anything special to have it called later. 1776don't have to do anything special to have it called later.
1774 1777
1775Apart from calling C<IO::AIO::poll_cb> when the event filehandle becomes 1778Apart from calling C<IO::AIO::poll_cb> when the event filehandle becomes
1776ready, it can be beneficial to call this function from loops which submit 1779ready, it can be beneficial to call this function from loops which submit
1777a lot of requests, to make sure the results get processed when they become 1780a lot of requests, to make sure the results get processed when they become
1778available and not just when the loop is finished and the event loop takes 1781available and not just when the loop is finished and the event loop takes
1787 poll => 'r', async => 1, 1790 poll => 'r', async => 1,
1788 cb => \&IO::AIO::poll_cb); 1791 cb => \&IO::AIO::poll_cb);
1789 1792
1790=item IO::AIO::poll_wait 1793=item IO::AIO::poll_wait
1791 1794
1792If there are any outstanding requests and none of them in the result 1795Wait until either at least one request is in the result phase or no
1793phase, wait till the result filehandle becomes ready for reading (simply 1796requests are outstanding anymore.
1794does a C<select> on the filehandle. This is useful if you want to 1797
1795synchronously wait for some requests to finish). 1798This is useful if you want to synchronously wait for some requests to
1799become ready, without actually handling them.
1796 1800
1797See C<nreqs> for an example. 1801See C<nreqs> for an example.
1798 1802
1799=item IO::AIO::poll 1803=item IO::AIO::poll
1800 1804

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines