4 <?php include "_skipif.inc"; ?>
11 $consumer = new pq\Connection(PQ_DSN);
12 $consumer->listen("test", function($channel, $message, $pid) {
13 printf("%s(%d): %s\n", $channel, $pid, $message);
16 $producer = new pq\Connection(PQ_DSN);
17 $producer->notify("test", "this is a test");
19 $consumer->exec("select 1");
21 $producer->notify("test", "this is an async test");
23 $r = array($consumer->socket);
25 var_dump(stream_select($r, $w, $e, NULL));
28 $producer->notify("other", "this should not show up");
30 var_dump(stream_select($r, $w, $e, 0));
33 $producer->notify("test", "just to be sure");
35 $r = array($consumer->socket);
37 var_dump(stream_select($r, $w, $e, NULL));
44 test(%d): this is a test
46 test(%d): this is an async test
49 test(%d): just to be sure