eio_cancel

(PECL eio >= 0.0.1dev)

eio_cancelCancels a request

说锟斤拷

eio_cancel ( resource $req ) : void

eio_cancel() cancels a request specified by req

锟斤拷锟斤拷

req

The request resource

pri

锟斤拷锟斤拷锟斤拷锟斤拷燃锟斤拷锟�EIO_PRI_DEFAULT锟斤拷EIO_PRI_MIN锟斤拷EIO_PRI_MAX 锟斤拷 NULL锟斤拷锟斤拷锟斤拷锟� NULL锟斤拷pri 锟斤拷锟斤拷为 EIO_PRI_DEFAULT锟斤拷

callback

callback 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟绞憋拷锟斤拷锟斤拷谩锟斤拷锟接ζワ拷锟揭伙拷锟皆拷停锟�

void callback(mixed $data, int $result[, resource $req]);
data

锟斤拷锟捷革拷锟斤拷锟斤拷锟斤拷没锟斤拷锟斤拷荨锟�

result

锟斤拷锟斤拷锟斤拷锟侥斤拷锟斤拷锟街碉拷锟酵拷锟斤拷锟斤拷锟接︼拷锟较低筹拷锟斤拷梅锟斤拷氐锟街碉拷锟�

req

锟斤拷选锟斤拷锟斤拷锟斤拷锟斤拷源锟斤拷锟缴憋拷 eio_get_last_error() 之锟斤拷暮锟斤拷锟绞癸拷谩锟�

data

Arbitrary variable passed to callback.

锟斤拷锟斤拷值

没锟叫凤拷锟斤拷值锟斤拷

锟斤拷锟斤拷

Example #1 eio_cancel() example

<?php
 
/* Is called when eio_nop() finished */
 
function my_nop_cb($data$result) {
  echo 
"my_nop "$data"\n";
 }

// This eio_nop() call will be cancelled
$req eio_nop(EIO_PRI_DEFAULT"my_nop_cb""1");
var_dump($req);
eio_cancel($req);

// This time eio_nop() will be processed
eio_nop(EIO_PRI_DEFAULT"my_nop_cb""2");

// Process requests
eio_event_loop();
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

resource(4) of type (EIO Request Descriptor)
my_nop 2

锟轿硷拷

  • eio_grp_cancel