&reftitle.examples;
Cancelling a request
]]>
&example.outputs.similar;
Calling eio_chmod
]]>
&example.outputs.similar;
Making a custom request
1001,
'data_modified' => "my custom data",
);
return $result;
}
$data = "my_custom_data";
$req = eio_custom("my_custom", EIO_PRI_DEFAULT, "my_custom_callback", $data);
var_dump($req);
eio_event_loop();
?>
]]>
&example.outputs.similar;
Grouping requests
0);
// Create eio_read() request and add it to the group
$req = eio_read($my_file_fd, 4, 0, EIO_PRI_DEFAULT, "my_grp_file_read_callback");
eio_grp_add($grp, $req);
}
/* Is called when eio_read() done */
function my_grp_file_read_callback($data, $result) {
global $my_file_fd, $grp;
var_dump($result);
// Create eio_close() request and add it to the group
$req = eio_close($my_file_fd);
eio_grp_add($grp, $req);
}
$grp = eio_grp("my_grp_done", "my_grp_data");
// Create eio_open() request and add it to the group
$req = eio_open($temp_filename, EIO_O_RDWR | EIO_O_APPEND , NULL,
EIO_PRI_DEFAULT, "my_grp_file_opened_callback", NULL);
eio_grp_add($grp, $req);
var_dump($grp);
eio_event_loop();
?>
]]>
&example.outputs.similar;
Using eio with libevent
]]>
&example.outputs.similar;