void pq\Connection::listen(string $channel, callable $listener)

Listen on $channel for notifications. See pq\Connection::unlisten().

Params:

Throws:

Example:

<?php

$conn = new pq\Connection;
$conn->listen("queue", function($channel, $message, $backend_pid) {
    printf("Connection on backend %d said %s\n", $backend_pid, $message);
});

?>