{"id":22927049,"url":"https://github.com/dvnc0/balin-queue","last_synced_at":"2026-02-01T09:33:37.456Z","repository":{"id":264588351,"uuid":"893760809","full_name":"dvnc0/balin-queue","owner":"dvnc0","description":"A small PHP database queue","archived":false,"fork":false,"pushed_at":"2025-07-10T06:33:45.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T09:48:26.442Z","etag":null,"topics":["mysql","php","php-queue","php8","queue","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvnc0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-25T06:54:00.000Z","updated_at":"2025-07-10T06:25:16.000Z","dependencies_parsed_at":"2025-04-01T15:41:37.684Z","dependency_job_id":"8b2bba66-0f31-454d-bcf4-ecef5d33a053","html_url":"https://github.com/dvnc0/balin-queue","commit_stats":null,"previous_names":["dvnc0/balin-queue"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dvnc0/balin-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvnc0%2Fbalin-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvnc0%2Fbalin-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvnc0%2Fbalin-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvnc0%2Fbalin-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvnc0","download_url":"https://codeload.github.com/dvnc0/balin-queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvnc0%2Fbalin-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28975259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T08:16:14.655Z","status":"ssl_error","status_checked_at":"2026-02-01T08:06:51.373Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mysql","php","php-queue","php8","queue","sqlite3"],"created_at":"2024-12-14T09:12:57.845Z","updated_at":"2026-02-01T09:33:37.441Z","avatar_url":"https://github.com/dvnc0.png","language":"PHP","readme":"# Balin Queue\nA simple database queue for PHP.\n\nSupports:\n- MySQL/MariaDB\n- SQLite3\n\n## Installation\n```bash\ncomposer require danc0/balin-queue\n```\n\n## Config\n```php\n$Balin = Balin::load([\n\t'path' =\u003e __DIR__,\n\t'database' =\u003e [\n\t\t'driver' =\u003e 'sqlite',\n\t\t'name' =\u003e 'balin_queue.sqlite',\n\t\t'dsn' =\u003e 'sqlite:' . __DIR__ . '/balin_queue.sqlite'\n\t]\n]);\n```\n\nDriver Options:\n- `sqlite`\n- `mysql`\n\nA flag file is created in `path` to indicate that the queue has been created, make sure the path is writable. This is also where the sqlite database will be created if using sqlite.\n\n## Usage\nYou would first create an instance of Balin somewhere with the config example above. To access the instance of Balin you would use the following code:\n\n```php\n$Balin = Balin::queue();\n```\n\nAt this point you have a number of public methods you can use.\n\n### Push to queue\n`push(string $task_name, array $payload, int $priority = 99, int $max_attempts = 3, string $scheduled_at = null)`\n\nThis will push a task to the queue. Use lower numbers for higher priority. The default priority is 99. The default max attempts is 3. The default scheduled at is null. Using scheduled at will delay the task until the time specified.\n\n### Getting a job\n`pop()` \n\nThis will return the next job in the queue. If there are no jobs in the queue it will return `null`. This will pull based on priority, scheduled at time, and created time.\n\n`popTask(string $task_name)`\n\nThis will return the next job in the queue for the specified task name. If there are no jobs in the queue it will return `null`. This will pull based on priority, scheduled at time, and created time, but only for the specified task name.\n\n### Update a job\n`success(int $id)`\n\nThis will mark the job as successful and remove it from the queue.\n\n`failure(int $id, string|null $scheduled_at = null)`\n\nThis will mark the job as failed and put it back in the queue. If the job has reached the max attempts it will be removed from the queue. If you pass a scheduled at time it will delay the job until that time.\n\n`error(int $id, string $error_message)`\n\nThis will mark the job as having an error and remove it from the queue.\n\n## Releasing orphaned jobs\n`releaseLockedJobs(int $locked_max_time = 3600)`\n\nThis will release any jobs that have been locked for more than the specified time. The default is 3600 seconds (1 hour).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvnc0%2Fbalin-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvnc0%2Fbalin-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvnc0%2Fbalin-queue/lists"}