张保健 97d25c38f3 首次提交 | 4 jaren geleden | |
---|---|---|
.. | ||
Capsule | 4 jaren geleden | |
Connectors | 4 jaren geleden | |
Console | 4 jaren geleden | |
Events | 4 jaren geleden | |
Failed | 4 jaren geleden | |
Jobs | 4 jaren geleden | |
BeanstalkdQueue.php | 4 jaren geleden | |
CallQueuedHandler.php | 4 jaren geleden | |
DatabaseQueue.php | 4 jaren geleden | |
FailingJob.php | 4 jaren geleden | |
InteractsWithQueue.php | 4 jaren geleden | |
InvalidPayloadException.php | 4 jaren geleden | |
Listener.php | 4 jaren geleden | |
ListenerOptions.php | 4 jaren geleden | |
LuaScripts.php | 4 jaren geleden | |
ManuallyFailedException.php | 4 jaren geleden | |
MaxAttemptsExceededException.php | 4 jaren geleden | |
NullQueue.php | 4 jaren geleden | |
Queue.php | 4 jaren geleden | |
QueueManager.php | 4 jaren geleden | |
QueueServiceProvider.php | 4 jaren geleden | |
README.md | 4 jaren geleden | |
RedisQueue.php | 4 jaren geleden | |
SerializesAndRestoresModelIdentifiers.php | 4 jaren geleden | |
SerializesModels.php | 4 jaren geleden | |
SqsQueue.php | 4 jaren geleden | |
SyncQueue.php | 4 jaren geleden | |
Worker.php | 4 jaren geleden | |
WorkerOptions.php | 4 jaren geleden | |
composer.json | 4 jaren geleden |
The Laravel Queue component provides a unified API across a variety of different queue services. Queues allow you to defer the processing of a time consuming task, such as sending an e-mail, until a later time, thus drastically speeding up the web requests to your application.
First, create a new Queue Capsule
manager instance. Similar to the "Capsule" provided for the Eloquent ORM, the queue Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible.
use Illuminate\Queue\Capsule\Manager as Queue;
$queue = new Queue;
$queue->addConnection([
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
]);
// Make this Capsule instance available globally via static methods... (optional)
$queue->setAsGlobal();
Once the Capsule instance has been registered. You may use it like so:
// As an instance...
$queue->push('SendEmail', array('message' => $message));
// If setAsGlobal has been called...
Queue::push('SendEmail', array('message' => $message));
For further documentation on using the queue, consult the Laravel framework documentation.