作者:kevinsimar
项目:laravel-sorted-queu
/**
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerSortedRedisConnector($manager)
{
$app = $this->app;
$manager->addConnector("sorted-redis", function () use($app) {
return new SortedRedisConnector($app["redis"]);
});
}
作者:owlgri
项目:plu
/**
* Register the Redis queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerRedisConnector($manager)
{
$app = $this->app;
$manager->extend('redis', function () use($app) {
return new RedisConnector($app['redis']);
});
}
作者:wasa
项目:GaeSupportL
/**
* Register the GAE queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerGaeConnector($manager)
{
$app = $this->app;
$manager->addConnector('gae', function () use($app) {
return new GaeConnector($app['encrypter'], $app['request']);
});
}
作者:deboor
项目:laravelcommandbusresquee
/**
* Register the Resque queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerResqueConnector($manager)
{
$manager->addConnector('resque', function () {
$config = Config::get('database.redis.default');
Config::set('queue.connections.resque', array_merge($config, ['driver' => 'resque']));
return new ResqueConnector();
});
}
作者:darrylkuh
项目:laravel-resqu
/**
* Register the Resque queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerResqueConnector($manager)
{
$connections = Config::get('queue.connections', []);
foreach ($connections as $connection) {
if ($connection['driver'] !== 'resque') {
$manager->addConnector($connection['driver'], function () {
return new ResqueConnector();
});
}
}
$manager->addConnector('resque', function () {
$config = Config::get('database.redis.default');
Config::set('queue.connections.resque', array_merge($config, ['driver' => 'resque']));
return new ResqueConnector();
});
}
作者:jordeytj
项目:vlamteddybee
/**
* Register the IronMQ queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerIronConnector($manager)
{
$app = $this->app;
$manager->addConnector('iron', function () use($app) {
return new IronConnector($app['encrypter'], $app['request']);
});
$this->registerIronRequestBinder();
}
作者:chefsplat
项目:laravel-mongodb-queu
/**
* Register the Async queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
*
* @return void
*/
protected function registerMongoDBConnector($manager)
{
$manager->addConnector('mongodb', function () {
return new MongoDBConnector($this->app['db']);
});
}
作者:mayconbordi
项目:l5-stomp-queu
/**
* Register the Stomp queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
*
* @return void
*/
protected function registerStompConnector($manager)
{
$manager->addConnector('stomp', function () {
return new StompConnector();
});
}
作者:lokiels
项目:laravel-mn
/**
* Register the MNS queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
*
* @return void
*/
protected function registerConnector($manager)
{
$manager->addConnector('mns', function () {
return new MNSConnector();
});
}
作者:razerbit
项目:frisco_foundr
/**
* Get the full name for the given connection.
*
* @param string $connection
* @return string
* @static
*/
public static function getName($connection = null)
{
return \Illuminate\Queue\QueueManager::getName($connection);
}
作者:barryvd
项目:laravel-async-queu
/**
* Register the Async queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
*
* @return void
*/
protected function registerAsyncConnector($manager)
{
$manager->addConnector('async', function () {
return new AsyncConnector($this->app['db']);
});
}
作者:sapwo
项目:portfoli
/**
* Register the Amazon SQS queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerSqsConnector($manager)
{
$manager->addConnector('sqs', function () {
return new SqsConnector();
});
}
作者:satriash
项目:tou
/**
* Determine if the application is in maintenance mode.
*
* @return bool
* @static
*/
public static function isDownForMaintenance()
{
return \Illuminate\Queue\QueueManager::isDownForMaintenance();
}
作者:shinichi8
项目:laravel4dem
/**
* Register the IronMQ queue connector.
*
* @param \Illuminate\Queue\QueueManager $manager
* @return void
*/
protected function registerIronConnector($manager)
{
$app = $this->app;
$manager->addConnector('iron', function () use($app) {
return new IronConnector($app['request']);
});
}
作者:RamaneekGil
项目:Rave
/**
* {@inheritdoc}
*
* @throws \RuntimeException Thrown if the queue has not been set.
*/
public function process($url, $data, array $headers = [])
{
if (empty($this->queue)) {
throw new RuntimeException('Queue not set');
}
$data = ['url' => $url, 'data' => $data, 'headers' => $headers, 'transport' => $this->transport->toArray()];
$this->queue->push('rcrowe\\Raven\\Handler\\Laravel\\Job', $data);
}
作者:MarkVaugh
项目:illuminate
/**
* Pushes a job into a specific queue connection.
*
* If you are using multiple SQS queues, this method might be useful.
* Instead of having to provide the whole queue URL every time you want to
* push a job into it, you just provide the name of the queue connection
* as set in the configuration file.
*
* @param mixed $job
* @param array $data
* @param string $connection Name of the connection
* @param string $queue
*
* @return mixed
*/
public function push($job, array $data, $connection = null, $queue = null)
{
if ($connection == null) {
return $this->manager->push($job, $data, $queue);
}
$connection = $this->manager->connection($connection);
return $connection->push($job, $data, $queue);
}
作者:SkysoulDesig
项目:TempAr
/**
* Handle the event.
*
* @param VoteWasOpened $event
* @return void
*/
public function handle(VoteWasOpened $event)
{
/**
* Queue OpenVoteCommand
*/
$command = new CloseVotingCommand($event->vote);
$delay = $event->vote->close_date->timestamp - $this->carbon->now()->timestamp;
$this->queue->laterOn('voting', $delay, $command);
}
作者:morrislapto
项目:laravel-queue-clea
/**
* {@inheritDoc}
*/
public function clear($connection, $queue)
{
$count = 0;
$connection = $this->manager->connection($connection);
while ($job = $connection->pop($queue)) {
$job->delete();
$count++;
}
return $count;
}
作者:flelievr
项目:EasyVisi
/**
* Listen to the given queue.
*
* @param string $connectionName
* @param string $queue
* @param int $delay
* @param int $memory
* @param int $sleep
* @param int $maxTries
* @return void
*/
public function pop($connectionName, $queue = null, $delay = 0, $memory = 128, $sleep = 3, $maxTries = 0)
{
$connection = $this->manager->connection($connectionName);
$job = $this->getNextJob($connection, $queue);
// If we're able to pull a job off of the stack, we will process it and
// then make sure we are not exceeding our memory limits for the run
// which is to protect against run-away memory leakages from here.
if (!is_null($job)) {
$this->process($this->manager->getName($connectionName), $job, $maxTries, $delay);
} else {
$this->sleep($sleep);
}
}
作者:SerdarSanr
项目:mailma
/**
* Queue a new e-mail message for sending after (n) seconds.
*
* @param int $delay
* @param string $queue
* @return void
*/
public function later($delay, $queue = null)
{
if ($this->queueManager) {
$swiftMessage = $this->message->getSwiftMessage();
$this->queueManager->later($delay, new SendEmailJob($swiftMessage), $queue);
}
}