(PECL eio >= 0.0.1dev)
eio_grp_add — Adds a request to the request group
eio_grp_add() adds a request to the request group.
grp
The request group resource returned by eio_grp()
req
The request resource
No value is returned.
Example #1 Grouping requests
<?php
// Create temporary file and write some bytes to it
$temp_filename = dirname(__FILE__) ."/eio-file.tmp";
$fp = fopen($temp_filename, "w");
fwrite($fp, "some data");
fclose($fp);
function my_grp_done($data, $result) {
var_dump($result == 0);
@unlink($data);
}
function my_grp_file_opened_callback($data, $result) {
global $grp;
// $result should contain the file descriptor
var_dump($result > 0);
// Create eio_read() request and add it to the group
The above example will output something similar to:
resource(6) of type (EIO Group Descriptor) bool(true) string(4) "some" bool(true)