Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/axotion/queuejobsbundle
Queue Job system like in Larave for Symfony
https://github.com/axotion/queuejobsbundle
queue redis symfony symfony3
Last synced: about 1 month ago
JSON representation
Queue Job system like in Larave for Symfony
- Host: GitHub
- URL: https://github.com/axotion/queuejobsbundle
- Owner: axotion
- Created: 2018-07-06T09:36:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-08T20:37:30.000Z (over 6 years ago)
- Last Synced: 2024-10-13T06:04:58.733Z (about 1 month ago)
- Topics: queue, redis, symfony, symfony3
- Language: PHP
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# QueueJobsBundle
Jobs system like in Laravel now in Symfony 3.x!
## About
Are you tired of fancy rabbitmq configurations? Would you like such a simplicity of work as in Laravel? That's what this package is for! I created it for the ecommerce project to process simple tasks, but it may also be useful to you
## Install
```
composer require evilnet/queue-jobs-bundle
```### Post-Install
Enable package in your AppKernel.php
```
$bundles = [
new Evilnet\QueueJobsBundle\QueueJobsBundle(),
];
```And add these parameters to your parameters.yml
```
queue_redis_ip: 127.0.0.1 (usually)
queue_redis_port: 6379 (usually)
default_queue_name: default
```And that's it! You can test it by running two commands in terminal
```
bin/console worker:start default
```And then demo dispatcher
```
bin/console dispatch:test
```You should see Hello World in terminal with worker
## Example code
Example Job Class
```
test_value = 'Hello from queue!';
}public function execute(): bool
{
echo $this->test_value."\n";
return true;
}
}
```Example of dispatch job
```
dispatcher = $dispatcher;
}public function test()
{
$hello_world_job = new HelloWorld();
$this->dispatcher->dispatch($hello_world_job, 'default'); //Queue name. You can use configured parameter here
}
}
```And to be honest... That's all!
## TODO BY PRIORITY
- Tests
- Better configuration for Bundle where you can choose adapter etc.
- Timeout for jobs. Execute after 15 minutes etc.
- More adapters. For now only redis is available### Tests
Coming soon!
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details