1. Go to this page and download the library: Download spiral/broadcast library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spiral / broadcast example snippets
use Spiral\Goridge\RPC\RPC;
use Spiral\RoadRunner\Broadcast\Broadcast;
cast->isAvailable()) {
throw new \LogicException('The [broadcast] plugin not available');
}
//
// Now we can send a message to a specific topic
//
$broadcast->publish('channel-1', 'message for channel #1');
// Now we can select the topic we need to work only with it
$topic = $broadcast->join(['channel-1', 'channel-2']);
// And send messages there
$topic->publish('message');
$topic->publish(['another message', 'third message']);