public handle ( string $sender, Kraken\Channel\Protocol\ProtocolInterface $protocol, integer $flags, callable $success = null, callable $failure = null, callable $cancel = null, float $timeout ) : boolean | ||
$sender | string | |
$protocol | Kraken\Channel\Protocol\ProtocolInterface | |
$flags | integer | |
$success | callable | |
$failure | callable | |
$cancel | callable | |
$timeout | float | |
return | boolean |
public function handle($sender, ProtocolInterface $protocol, $flags, callable $success = null, callable $failure = null, callable $cancel = null, $timeout = 0.0)
{
$callback = $this->handler;
$callback($sender, $protocol, $flags, $success, $failure, $cancel, $timeout);
if ($this->limit > 0) {
$this->limit--;
if ($this->limit === 0) {
$this->cancel();
}
}
return $this->propagate;
}