src/PubSub/DispatcherLoop.php
public function run()
    {
        foreach ($this->pubsub as $message) {
            $kind = $message->kind;

            if ($kind !== Consumer::MESSAGE && $kind !== Consumer::PMESSAGE) {
                if (isset($this->subscriptionCallback)) {
                    $callback = $this->subscriptionCallback;
                    call_user_func($callback, $message);
                }

                continue;
            }

            if (isset($this->callbacks[$message->channel])) {
                $callback = $this->callbacks[$message->channel];
                call_user_func($callback, $message->payload);
            } elseif (isset($this->defaultCallback)) {
                $callback = $this->defaultCallback;
                call_user_func($callback, $message);
            }
        }
    }
public function run()
    {
        foreach ($this->pubsub as $message) {
            $kind = $message->kind;

            if ($kind !== Consumer::MESSAGE && $kind !== Consumer::PMESSAGE) {
                if (isset($this->subscriptionCallback)) {
                    $callback = $this->subscriptionCallback;
                    call_user_func($callback, $message);
                }

                continue;
            }

            if (isset($this->callbacks[$message->channel])) {
                $callback = $this->callbacks[$message->channel];
                call_user_func($callback, $message->payload);
            } elseif (isset($this->defaultCallback)) {
                $callback = $this->defaultCallback;
                call_user_func($callback, $message);
            }
        }
    }
public function run ( ) { foreach ( $ this -> pubsub as $ message ) { $ kind = $ message -> kind ; if ( $ kind !== Consumer :: MESSAGE && $ kind !== Consumer :: PMESSAGE ) { if ( isset ( $ this -> subscriptionCallback ) ) { $ callback = $ this -> subscriptionCallback ; call_user_func ( $ callback , $ message ) ; } continue ; } if ( isset ( $ this -> callbacks [ $ message -> channel ] ) ) { $ callback = $ this -> callbacks [ $ message -> channel ] ; call_user_func ( $ callback , $ message -> payload ) ; } elseif ( isset ( $ this -> defaultCallback ) ) { $ callback = $ this -> defaultCallback ; call_user_func ( $ callback , $ message ) ; } } }
Starts the dispatcher loop.
Starts the dispatcher loop .