作者:adamnicholso
项目:kye
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);
}
作者:satriash
项目:tou
/**
* 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);
}
作者:jorzhikgi
项目:MLM-Nexu
/**
* 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);
}