diff --git a/examples/pubsub.php b/examples/pubsub.php new file mode 100644 index 0000000..5af45f0 --- /dev/null +++ b/examples/pubsub.php @@ -0,0 +1,26 @@ +subscribe('amphp'); + +async(function () use ($client) { + delay(3); // wait for subscription to be active + + $client->publish('amphp', 'New release is out!'); +}); + +foreach ($subscription as $message) { + var_dump($message); + + break; +}