PHPDaemon\SockJS\Methods\Generic::s2c PHP Method

s2c() public method

s2c
public s2c ( object $redis ) : void
$redis object
return void
    public function s2c($redis)
    {
        if (!$redis) {
            return;
        }
        list(, $chan, $msg) = $redis->result;
        $frames = json_decode($msg, true);
        if (!is_array($frames) || !sizeof($frames)) {
            return;
        }
        foreach ($frames as $frame) {
            $this->sendFrame($frame);
        }
        if (!in_array('stream', $this->pollMode)) {
            $this->heartbeatOnFinish = false;
            $this->stop();
            return;
        }
        if ($this->gcEnabled) {
            $this->gcCheck();
        }
    }