{"id":20330545,"url":"https://github.com/mle86/php-wq-beanstalkd","last_synced_at":"2025-09-09T08:37:01.685Z","repository":{"id":57018164,"uuid":"92552412","full_name":"mle86/php-wq-beanstalkd","owner":"mle86","description":"A Beanstalkd adapter for WQ (https://github.com/mle86/php-wq)","archived":false,"fork":false,"pushed_at":"2020-06-18T13:59:43.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T12:43:30.271Z","etag":null,"topics":["beanstalk","beanstalk-worker","beanstalkd","beanstalkd-tubes","php","php-library","work-queue","wq"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mle86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-26T22:16:34.000Z","updated_at":"2020-06-18T13:54:06.000Z","dependencies_parsed_at":"2022-08-22T11:31:21.040Z","dependency_job_id":null,"html_url":"https://github.com/mle86/php-wq-beanstalkd","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mle86/php-wq-beanstalkd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-beanstalkd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-beanstalkd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-beanstalkd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-beanstalkd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mle86","download_url":"https://codeload.github.com/mle86/php-wq-beanstalkd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mle86%2Fphp-wq-beanstalkd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268348774,"owners_count":24236302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["beanstalk","beanstalk-worker","beanstalkd","beanstalkd-tubes","php","php-library","work-queue","wq"],"created_at":"2024-11-14T20:16:38.314Z","updated_at":"2025-08-02T07:39:56.044Z","avatar_url":"https://github.com/mle86.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WQ-Beanstalkd  (`mle86/wq-beanstalkd`)\n\nThis package contains the PHP class\n\u003ccode\u003emle86\\WQ\\WorkServerAdapter\\\\\u003cb\u003eBeanstalkdWorkServer\u003c/b\u003e\u003c/code\u003e.\n\nIt supplements the\n[**mle86/wq**](https://github.com/mle86/php-wq) package\nby implementing its `WorkServerAdapter` interface.\n\nIt connects to a Beanstalkd server\nusing the [pda/pheanstalk](https://github.com/pda/pheanstalk) package\nby Paul Annesley.\n\n\n# Version and Compatibility\n\nThis is\n**version 1.0.2**\nof `mle86/wq-beanstalkd`.\n\nIt was developed for\nversion 1.0.0\nof `mle86/wq`\nand should be compatible\nwith all of its future 1.x versions as well.\n\n\n# Installation and Dependencies\n\n```\n$ composer require mle86/wq-beanstalkd\n```\n\nIt requires PHP 7.1,\n[mle86/wq](https://github.com/mle86/php-wq),\nand [pda/pheanstalk](https://github.com/pda/pheanstalk).\n\n\n# Class reference\n\n\u003ccode\u003eclass mle86\\WQ\\WorkServerAdapter\\\\\u003cb\u003eBeanstalkdWorkServer\u003c/b\u003e implements WorkServerAdapter\u003c/code\u003e\n\n`getNextQueueEntry()` uses the `RESERVE` command,\n`buryEntry()` uses the `BURY` command,\n`storeJob()` and `requeueEntry()` use the `PUT` command,\nand `deleteEntry()` uses the `DELETE` command.\n\n*Work Queues* are Beanstalkd's “tubes”.\n\n* \u003ccode\u003epublic function \u003cb\u003e__construct\u003c/b\u003e (Pheanstalk $pheanstalk)\u003c/code\u003e  \n    Constructor.\n    Takes an already-configured `Pheanstalk` instance to work with.\n    Does not attempt to establish a connection itself –\n    use the `connect()` factory method for that instead.\n* \u003ccode\u003epublic static function \u003cb\u003econnect\u003c/b\u003e (string $host = \"localhost\", int $port = PheanstalkInterface::DEFAULT\\_PORT, int $connectTimeout = null)\u003c/code\u003e  \n    Factory method.\n    See [Pheanstalk::__construct](https://github.com/pda/pheanstalk/blob/master/src/Pheanstalk.php)\n    for the parameter descriptions.\n\nInterface methods\nwhich are documented in the [`WorkServerAdapter`](https://github.com/mle86/php-wq/blob/master/doc/Ref_WorkServerAdapter_interface.md) interface:\n\n* \u003ccode\u003epublic function \u003cb\u003estoreJob\u003c/b\u003e (string $workQueue, Job $job, int $delay = 0)\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003egetNextQueueEntry\u003c/b\u003e ($workQueue, int $timeout = DEFAULT\\_TIMEOUT) : ?QueueEntry\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003eburyEntry\u003c/b\u003e (QueueEntry $entry)\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003erequeueEntry\u003c/b\u003e (QueueEntry $entry, int $delay, string $workQueue = null)\u003c/code\u003e\n* \u003ccode\u003epublic function \u003cb\u003edeleteEntry\u003c/b\u003e (QueueEntry $entry)\u003c/code\u003e\n\n\n# Usage example\n\n```php\n\u003c?php\nuse mle86\\WQ\\WorkServerAdapter\\BeanstalkdWorkServer;\nuse mle86\\WQ\\WorkProcessor;\nuse mle86\\WQ\\Job\\Job;\n\n$processor = new WorkProcessor( BeanstalkdWorkServer::connect(\"localhost\") );\n\nwhile (true) {\n    $processor-\u003eprocessNextJob(\"mail\", function(Job $job) {\n        $job-\u003e...;\n    });\n}\n```\n\nThis executes all jobs available in the local Beanstalkd server's “`mail`” tube, forever.\nIt will however abort if one of the jobs throws an exception –\nyou might want to add a logging try-catch block around the `processNextJob()` call\nas shown in [WQ's “Quick Start” example](https://github.com/mle86/php-wq#quick-start).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmle86%2Fphp-wq-beanstalkd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmle86%2Fphp-wq-beanstalkd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmle86%2Fphp-wq-beanstalkd/lists"}