Vinelab\Minion\Client::subscribe PHP Method

subscribe() public method

Subscribe to a topic and specify a callback for it.
See also: Thruway\ClientSession::subscribe
public subscribe ( string $topic, string | Closur\Closure $callback, array $options = null, boolean $isFunction = false ) : Promise
$topic string The topic name.
$callback string | Closur\Closure The callable to be called when the topic received a publish.
$options array Will be passed straight to thruway @see \Thruway\ClientSession::subscribe
$isFunction boolean Specify whether you're passing in a function from a different scope, Set this to TRUE to avoid calling the passed callable from this provider's scope.
return React\Promise\Promise
    public function subscribe($topic, $callback, $options = null, $isFunction = false)
    {
        return $this->getSession()->subscribe($this->prepareTopic($topic), $this->wrapWithProxy($callback, $isFunction), $options);
    }