本文整理匯總了PHP中Illuminate\Queue\SyncQueue類的典型用法代碼示例。如果您正苦於以下問題:PHP SyncQueue類的具體用法?PHP SyncQueue怎麽用?PHP SyncQueue使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SyncQueue類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_queue_with_synchronous_driver_and_in_memory_pubsub_fires_event_with_expected_return_value
public function test_queue_with_synchronous_driver_and_in_memory_pubsub_fires_event_with_expected_return_value()
{
$pubsub = new InMemoryPubSub();
$container = new Container();
$container->singleton(IlluminateQueueHandler::class, function () use($pubsub) {
return new IlluminateQueueHandler($pubsub, new Serializer());
});
$driver = new SyncQueue();
$driver->setContainer($container);
$called = false;
$pubsub->on('kyew:task:random-task-id', function ($publishedValue) use(&$called) {
$this->assertEquals('foo!bar!', $publishedValue);
$called = true;
});
$queue = new IlluminateQueue($driver, new Serializer());
$queue->push('random-task-id', function () {
return 'foo!bar!';
});
$this->assertTrue($called);
}
示例2: setEncrypter
/**
* Set the encrypter instance.
*
* @param \Illuminate\Contracts\Encryption\Encrypter $crypt
* @return void
* @static
*/
public static function setEncrypter($crypt)
{
//Method inherited from \Illuminate\Queue\Queue
\Illuminate\Queue\SyncQueue::setEncrypter($crypt);
}
示例3: setContainer
/**
* Set the IoC container instance.
*
* @param \Illuminate\Container\Container $container
* @return void
* @static
*/
public static function setContainer($container)
{
//Method inherited from \Illuminate\Queue\Queue
\Illuminate\Queue\SyncQueue::setContainer($container);
}