{"repo":"n0nag0n/simple-job-queue","free":true,"listed":false,"github":"https://github.com/n0nag0n/simple-job-queue","clone":"git clone https://github.com/n0nag0n/simple-job-queue.git","description":"A simple library for interfacing with other job queue providers that gives you plenty of flexibility. Currently supports MySQL, SQLite, and Beanstalkd.","language":"PHP","stars":38,"topics":["php","php-library","job-queue","mysql","mariadb","sqlite","beanstalkd","beanstalk","beanstalk-worker"],"license":"MIT","category":"databases-storage","readme_excerpt":"Simple PHP Job Queue I wanted/needed a simple job queue that could be used on a database, but also used with other adapters like beanstalkd/redis/etc if needed. Didn't really see a good option for a standalone job queue for a database. Install Requirements: PHP 7.4 or higher. Note on Beanstalkd: The pda/pheanstalk package is only needed if you use the Beanstalkd adapter. It is listed under suggest in composer.json (not a hard requirement) so pure database users are not forced to install it. Usage In order for this to work, you need a way to add jobs to the queue and a way to process the jobs (a worker). Below are examples of how to add a job to the queue and how to process the job. Adding a new job MySQL PostgreSQL SQLite3 Beanstalkd Running a worker See example worker.php for file or see below: Handling long processes Supervisord is going to be your jam. Look up the many, many articles on how to implement this. Configurable options Several behaviors can be tuned via the $options array passed to the constructor (or setOptions() ): - stale timeout (int, seconds): How long to wait before a reserved job is considered \"stale\" and can be re-claimed by another worker (DB backends only). Default: 300 (5 minutes). This default preserves the historical behavior exactly. Example: Additional methods (additive, non-breaking) New methods have been added that do not change any existing behavior: - releaseJob($job) — Un-reserves a job that was previously obtained via getNextJobAndReserve() ","default_branch":null,"files":null,"tree":[],"storefront":"/r/n0nag0n","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/n0nag0n/simple-job-queue/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}