royalcms / queue
The Royalcms Queue package.
Requires
- php: ^7.2.5
- ext-json: *
- illuminate/queque: ^7.0
- royalcms/console: ^7.0
- royalcms/container: ^7.0
- royalcms/contracts: ^7.0
- royalcms/database: ^7.0
- royalcms/filesystem: ^7.0
- royalcms/pipeline: ^7.0
- royalcms/support: ^7.0
Suggests
- aws/aws-sdk-php: Required to use the SQS queue driver (~3.0).
- iron-io/iron_mq: Required to use the iron queue driver (~2.0).
- pda/pheanstalk: Required to use the beanstalk queue driver (~3.0).
- royalcms/redis: Required to use the redis queue driver (5.0.*).
This package is auto-updated.
Last update: 2024-10-22 17:06:44 UTC
README
The Royalcms 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 Royalcms\Component\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 Royalcms framework documentation.