{"id":24624853,"url":"https://github.com/agencypmg/queue-pheanstalk","last_synced_at":"2026-02-12T23:13:30.751Z","repository":{"id":57043069,"uuid":"53211878","full_name":"AgencyPMG/queue-pheanstalk","owner":"AgencyPMG","description":"A driver for pmg/queue that's backed by Beanstalkd and the Pheanstalk client library.","archived":false,"fork":false,"pushed_at":"2024-01-05T15:03:32.000Z","size":62,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-01-18T06:39:22.737Z","etag":null,"topics":["beanstalkd","pheanstalk","php","pmg-queue","pmg-queue-driver","queue"],"latest_commit_sha":null,"homepage":"http://pmg-queue.readthedocs.io/en/latest/","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/AgencyPMG.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-05T16:48:48.000Z","updated_at":"2021-10-15T02:06:57.000Z","dependencies_parsed_at":"2023-02-09T12:46:00.513Z","dependency_job_id":null,"html_url":"https://github.com/AgencyPMG/queue-pheanstalk","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-pheanstalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-pheanstalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-pheanstalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AgencyPMG%2Fqueue-pheanstalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AgencyPMG","download_url":"https://codeload.github.com/AgencyPMG/queue-pheanstalk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235534342,"owners_count":19005470,"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","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":["beanstalkd","pheanstalk","php","pmg-queue","pmg-queue-driver","queue"],"created_at":"2025-01-25T04:11:55.427Z","updated_at":"2026-02-12T23:13:30.710Z","avatar_url":"https://github.com/AgencyPMG.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pmg/queue-pheanstalk\n\nA driver for [pmg/queue](https://github.com/AgencyPMG/Queue) backed by \n[Pheanstalk](https://github.com/pda/pheanstalk) and [Beanstalkd](http://kr.github.io/beanstalkd/).\n\nSee the [pmg/queue readme](https://github.com/AgencyPMG/Queue/blob/master/README.md)\nfor the documentation of how the queue system as a whole works.\n\nSee the [examples](https://github.com/AgencyPMG/queue-pheanstalk/tree/master/examples)\ndirectory for examples of how to glue everything together.\n\n## Quick Example\n\n[Pheanstalk](https://github.com/pda/pheanstalk) is a PHP library for interacting\nwith [Beanstalkd](http://kr.github.io/beanstalkd/). `PheanstalkDriver` lets you\ntake advantage of Beanstalkd as a queue backend.\n\n\n```php\nuse Pheanstalk\\Pheanstalk;\nuse PMG\\Queue\\DefaultConsumer;\nuse PMG\\Queue\\Driver\\PheanstalkDriver;\nuse PMG\\Queue\\Serializer\\NativeSerializer;\nuse PMG\\Queue\\Serializer\\SigningSerializer;\n\n// ...\n\n$serilizer = new NativeSerializer('this is the secret key');\n\n$driver = new PheanstalkDriver(new \\Pheanstalk\\Pheanstalk('localhost'), $serializer, [\n    // how long easy message has to execute in seconds\n    'ttr'               =\u003e 100,\n\n    // the \"priority\" of the message. High priority messages are\n    // consumed first.\n    'priority'          =\u003e 1024,\n\n    // The delay between inserting the message and when it\n    // becomes available for consumption\n    'delay'             =\u003e 0,\n\n    // The ttr for retries jobs\n    'retry-ttr'         =\u003e 100,\n\n    // the priority for retried jobs\n    'retry-priority'    =\u003e 1024,\n\n    // When jobs fail, they are \"burieds\" in beanstalkd with this priority\n    'fail-priority'     =\u003e 1024,\n\n    // A call to `dequeue` blocks for this number of seconds. A zero or\n    // falsy value will block until a job becomes available\n    'reserve-timeout'   =\u003e 10,\n]);\n\n// $handler instanceof PMG\\Queue\\MessageHandler\n$consumer = new DefaultConsumer($driver, $handler);\n```\n\n## Dealing with Failed Messages\n\nBy default, `PheanstalkDriver` will [bury](https://github.com/kr/beanstalkd/blob/b7b4a6a14b7e8d096dc8cbc255b23be17a228cbb/doc/protocol.txt#L291-L293)\nany message passed to `PheanstalkDriver::fail`. This is, generally, a good thing\nif there are no other accountability measures around your queue system.\n\nThat said, `pmg/queue` does nothing for you regarding *kicking* jobs back to a\nready state. If there are other accountability measures around your queue\nimplementation and you'd rather just delete failed messages after they've been\nretried, use a different `FailureStrategy`.\n\n```php\nuse Pheanstalk\\Pheanstalk;\nuse PMG\\Queue\\DefaultConsumer;\nuse PMG\\Queue\\Driver\\PheanstalkDriver;\nuse PMG\\Queue\\Driver\\Pheanstalk\\DeleteFailureStrategy;\nuse PMG\\Queue\\Serializer\\NativeSerializer;\n\n// ...\n\n$serilizer = new NativeSerializer('this is the secret key');\n$failureStrategy = new DeleteFailureStrategy();\n\n$driver = new PheanstalkDriver(new \\Pheanstalk\\Pheanstalk('localhost'), $serializer, [\n    // as above\n], $failureStrategy);\n\n// $handler instanceof PMG\\Queue\\MessageHandler\n$consumer = new DefaultConsumer($driver, $handler);\n```\n\nFeel free to implement `PMG\\Queue\\Driver\\Pheanstalk\\FailureStrategy` if a\ndifferent solution is needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagencypmg%2Fqueue-pheanstalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagencypmg%2Fqueue-pheanstalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagencypmg%2Fqueue-pheanstalk/lists"}