Askedio\LaravelRatchet\Pusher::onSubscribe PHP Method

onSubscribe() public method

A request to subscribe to a topic has been made.
public onSubscribe ( Ratchet\ConnectionInterface $conn, string | Topic $topic )
$conn Ratchet\ConnectionInterface
$topic string | Topic The topic to subscribe to
    public function onSubscribe(ConnectionInterface $conn, $topic)
    {
        $this->console->info("onSubscribe: {$conn->WAMP->sessionId} topic: {$topic} {$topic->count()}");
        if (!array_key_exists($topic->getId(), $this->subscribedTopics)) {
            $this->subscribedTopics[$topic->getId()] = $topic;
            $this->console->info("subscribed to topic {$topic}");
        }
    }