src/Queue/Subscribe/PredisSubscribeEventQueue.php
public function subscribe(callable $handler)
    {
        $this->handlers[] = $handler;

        // laze subscribe
        if (!$this->subscribed) {
            $this->client->subscribe($this->queue_name, function ($message) {
                $this->handle($message);
            });
            $this->subscribed = true;
        }
    }
public function subscribe(callable $handler)
    {
        $this->handlers[] = $handler;

        // laze subscribe
        if (!$this->subscribed) {
            $this->client->subscribe($this->queue_name, function ($message) {
                $this->handle($message);
            });
            $this->subscribed = true;
        }
    }
public function subscribe ( callable $ handler ) { $ this -> handlers [ ] = $ handler ; // laze subscribe if ( ! $ this -> subscribed ) { $ this -> client -> subscribe ( $ this -> queue_name , function ( $ message ) { $ this -> handle ( $ message ) ; } ) ; $ this -> subscribed = true ; } }
Subscribe on event queue.

@param callable $handler
Subscribe on event queue .