public function monitor(callable $callback, $autostart = true)
    {
        $monitor = new Monitor\Consumer($this, $callback);

        if ($autostart) {
            $monitor->start();
        }

        return $monitor;
    }
public function monitor(callable $callback, $autostart = true)
    {
        $monitor = new Monitor\Consumer($this, $callback);

        if ($autostart) {
            $monitor->start();
        }

        return $monitor;
    }
public function monitor ( callable $ callback , $ autostart = true ) { $ monitor = new Monitor \ Consumer ( $ this , $ callback ) ; if ( $ autostart ) { $ monitor -> start ( ) ; } return $ monitor ; }
Creates a new monitor consumer.

@param callable $callback  Callback invoked on each payload message.
@param bool     $autostart Flag indicating if the consumer should be auto-started.

@return Monitor\Consumer
Creates a new monitor consumer .