ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.pod
(Generate patch)

Comparing libeio/eio.pod (file contents):
Revision 1.34 by root, Mon Mar 11 07:59:41 2013 UTC vs.
Revision 1.36 by root, Sun Jan 24 16:36:20 2016 UTC

104This callback is invoked when libeio detects that all pending requests 104This callback is invoked when libeio detects that all pending requests
105have been handled. It is "edge-triggered", that is, it will only be 105have been handled. It is "edge-triggered", that is, it will only be
106called once after C<want_poll>. To put it differently, C<want_poll> and 106called once after C<want_poll>. To put it differently, C<want_poll> and
107C<done_poll> are invoked in pairs: after C<want_poll> you have to call 107C<done_poll> are invoked in pairs: after C<want_poll> you have to call
108C<eio_poll ()> until either C<eio_poll> indicates that everything has been 108C<eio_poll ()> until either C<eio_poll> indicates that everything has been
109handled or C<done_poll> has been called, which signals the same. 109handled or C<done_poll> has been called, which signals the same - only one
110method is needed.
110 111
111Note that C<eio_poll> might return after C<done_poll> and C<want_poll> 112Note that C<eio_poll> might return after C<done_poll> and C<want_poll>
112have been called again, so watch out for races in your code. 113have been called again, so watch out for races in your code.
113 114
115It is quite common to have an empty C<done_call> callback and only use
116the return value from C<eio_poll>, or, when C<eio_poll> is configured to
117handle all outstanding replies, it's enough to call C<eio_poll> once.
118
114As with C<want_poll>, this callback is called while locks are being held, 119As with C<want_poll>, this callback is called while locks are being held,
115so you I<must not call any libeio functions form within this callback>. 120so you I<must not call any libeio functions from within this callback>.
116 121
117=item int eio_poll () 122=item int eio_poll ()
118 123
119This function has to be called whenever there are pending requests that 124This function has to be called whenever there are pending requests that
120need finishing. You usually call this after C<want_poll> has indicated 125need finishing. You usually call this after C<want_poll> has indicated
290 295
291Cancel the request (and all its subrequests). If the request is currently 296Cancel the request (and all its subrequests). If the request is currently
292executing it might still continue to execute, and in other cases it might 297executing it might still continue to execute, and in other cases it might
293still take a while till the request is cancelled. 298still take a while till the request is cancelled.
294 299
295Even if cancelled, the finish callback will still be invoked - the 300When cancelled, the finish callback will not be invoked.
296callbacks of all cancellable requests need to check whether the request
297has been cancelled by calling C<EIO_CANCELLED (req)>:
298
299 static int
300 my_eio_cb (eio_req *req)
301 {
302 if (EIO_CANCELLED (req))
303 return 0;
304 }
305
306In addition, cancelled requests will I<either> have C<< req->result >>
307set to C<-1> and C<errno> to C<ECANCELED>, or I<otherwise> they were
308successfully executed, despite being cancelled (e.g. when they have
309already been executed at the time they were cancelled).
310 301
311C<EIO_CANCELLED> is still true for requests that have successfully 302C<EIO_CANCELLED> is still true for requests that have successfully
312executed, as long as C<eio_cancel> was called on them at some point. 303executed, as long as C<eio_cancel> was called on them at some point.
313 304
314=back 305=back

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines