本文整理汇总了PHP中Resque_Event::stopListening方法的典型用法代码示例。如果您正苦于以下问题:PHP Resque_Event::stopListening方法的具体用法?PHP Resque_Event::stopListening怎么用?PHP Resque_Event::stopListening使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resque_Event
的用法示例。
在下文中一共展示了Resque_Event::stopListening方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stopEvent
private static function stopEvent($method, $args)
{
$callback_method = str_replace("Stop", '', $method);
if (!self::isCallableEvent($callback_method)) {
throw new PHPResqueEventException("The {$callback_method} does not exists. So you can't stop it.");
}
if (!\Resque_Event::stopListening($callback_method, $args)) {
throw new PHPResqueEventException("The {$callback_method} can not stopped.");
}
}
示例2: testStopListeningRemovesListener
public function testStopListeningRemovesListener()
{
$callback = 'beforePerformEventCallback';
$event = 'beforePerform';
Resque_Event::listen($event, array($this, $callback));
Resque_Event::stopListening($event, array($this, $callback));
$job = $this->getEventTestJob();
$this->worker->perform($job);
$this->worker->work(0);
$this->assertNotContains($callback, $this->callbacksHit, $event . ' callback (' . $callback . ') was called though Resque_Event::stopListening was called');
}