lumphp / laravel-queue
The Illuminate Queue package.
Requires
- php: ^7.3|^8.0
- ext-json: *
- lumphp/laravel-collections: ^8.0
- lumphp/laravel-console: ^8.0
- lumphp/laravel-container: ^8.0
- lumphp/laravel-contracts: ^8.0
- lumphp/laravel-database: ^8.0
- lumphp/laravel-filesystem: ^8.0
- lumphp/laravel-pipeline: ^8.0
- lumphp/laravel-support: ^8.0
- opis/closure: ^3.6
- ramsey/uuid: ^4.0
- symfony/process: ^5.1.4
Suggests
- ext-pcntl: Required to use all features of the queue worker.
- ext-posix: Required to use all features of the queue worker.
- aws/aws-sdk-php: Required to use the SQS queue driver and DynamoDb failed job storage (^3.189.0).
- lumphp/laravel-redis: Required to use the Redis queue driver (^8.0).
- pda/pheanstalk: Required to use the Beanstalk queue driver (^4.0).
This package is auto-updated.
Last update: 2024-11-21 06:31:24 UTC
README
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.
Usage Instructions
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', ['message' => $message]); // If setAsGlobal has been called... Queue::push('SendEmail', ['message' => $message]);
For further documentation on using the queue, consult the Laravel framework documentation.