add example
[mdref/mdref-pq] / pq / Connection / listenAsync.md
1 # void pq\Connection::listenAsync(string $channel, callable $listener)
2
3 [Asynchronously](pq/Connection/: Asynchronous Usage) start listening on $channel for notifcations.
4 See pq\Connection::listen().
5
6 ## Params:
7
8 * string $channel
9 The channel to listen on.
10 * callable $listener as function(string $channel, string $message, int $pid)
11 A callback automatically called whenever a notification on $channel arrives.
12
13 ## Throws:
14
15 * pq\Exception\InvalidArgumentException
16 * pq\Exception\BadMethodCallException
17 * pq\Exception\RuntimeException