autobus-php / autobus-bus-bundle
AutobusBusBundle
Installs: 199
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 4
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0
- enqueue/enqueue-bundle: 0.10.*
- knplabs/knp-paginator-bundle: 5.6.*
- mtdowling/cron-expression: 1.2.*
Suggests
- enqueue/gps: To use Google PubSub queuing system
- enqueue/sqs: To use AWS SQS queuing system
- dev-master
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.2.x-dev
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.x-dev
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.12
- 2.0.11
- 2.0.10
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-code-enhancements
- dev-webjob-path
This package is auto-updated.
Last update: 2024-11-06 16:32:10 UTC
README
A PHP Extensible Service Bus
Configure your atomic jobs in order to be played by cron, queue listener or webservice.
Requirements
- PHP 8+
Installation
Download the Bundle
composer require autobus-php/autobus-bus-bundle
Download desired queuing bundle
- If you want to use Google PubSub (https://cloud.google.com/pubsub/docs/overview):
composer require enqueue/gps:0.10.*
- If you want to use AWS SQS (https://aws.amazon.com/fr/sqs):
composer require enqueue/sqs:0.10.*
Environment variables
Update your .env
file to add:
# 'gps:' for Google PubSub / 'sqs:' for AWS SQS
ENQUEUE_DSN=sqs:
# Only for AWS SQS usage
AWS_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
Configuration
Topic jobs
2 queuing systems are available:
- With Google PubSub:
Execute the following command with Supervisor tool:
php bin/console autobus:pubsub:consume
-
With AWS SQS:
Add the following line to your crontab:
*/5 * * * * php bin/console autobus:sqs:consume
Cron jobs
Add the following line to your crontab:
* * * * * php bin/console autobus:cron:run
Usage
Create a job
To create a new job:
- Create it's class, implementing
Autobus\Bundle\BusBundle\Runner\RunnerInterface
; it may extendAutobus\Bundle\BusBundle\Runner\AbstractRunner
- Declare it as a service in your bundle's
services.yml
, with tagbus.runner
- Create an instance from the web UI