1function getUrl($url){
2 $ch = curl_init($url);
3 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
4 $response = curl_exec($ch);
5 curl_close($ch);
6 return $response;
7}
1
2<?php
3 /* Is called when eio_nop() finished */
4 function my_nop_cb($data, $result) {
5 echo "my_nop ", $data, "\n";
6 }
7
8// This eio_nop() call will be cancelled
9$req = eio_nop(EIO_PRI_DEFAULT, "my_nop_cb", "1");
10var_dump($req);
11eio_cancel($req);
12
13// This time eio_nop() will be processed
14eio_nop(EIO_PRI_DEFAULT, "my_nop_cb", "2");
15
16// Process requests
17eio_event_loop();
18?>
19
20