… | |
… | |
290 | |
290 | |
291 | Cancel the request (and all its subrequests). If the request is currently |
291 | Cancel the request (and all its subrequests). If the request is currently |
292 | executing it might still continue to execute, and in other cases it might |
292 | executing it might still continue to execute, and in other cases it might |
293 | still take a while till the request is cancelled. |
293 | still take a while till the request is cancelled. |
294 | |
294 | |
295 | Even if cancelled, the finish callback will still be invoked - the |
295 | When cancelled, the finish callback will not be invoked. |
296 | callbacks of all cancellable requests need to check whether the request |
|
|
297 | has 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 | |
|
|
306 | In addition, cancelled requests will I<either> have C<< req->result >> |
|
|
307 | set to C<-1> and C<errno> to C<ECANCELED>, or I<otherwise> they were |
|
|
308 | successfully executed, despite being cancelled (e.g. when they have |
|
|
309 | already been executed at the time they were cancelled). |
|
|
310 | |
296 | |
311 | C<EIO_CANCELLED> is still true for requests that have successfully |
297 | C<EIO_CANCELLED> is still true for requests that have successfully |
312 | executed, as long as C<eio_cancel> was called on them at some point. |
298 | executed, as long as C<eio_cancel> was called on them at some point. |
313 | |
299 | |
314 | =back |
300 | =back |