{"id":17937792,"url":"https://github.com/xobotyi/beansclient","last_synced_at":"2025-06-19T06:34:25.847Z","repository":{"id":30623100,"uuid":"124200863","full_name":"xobotyi/beansclient","owner":"xobotyi","description":"Robust PHP client for beanstalkd work queue","archived":false,"fork":false,"pushed_at":"2023-03-10T00:58:49.000Z","size":324,"stargazers_count":92,"open_issues_count":3,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-20T09:04:27.065Z","etag":null,"topics":["beanstalk","beanstalkd","client","php","queue"],"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/xobotyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"patreon":"xobotyi"}},"created_at":"2018-03-07T08:04:03.000Z","updated_at":"2025-04-11T10:07:25.000Z","dependencies_parsed_at":"2024-06-20T00:02:45.747Z","dependency_job_id":"2090a29d-9f3a-4b61-ae4f-36e4146af021","html_url":"https://github.com/xobotyi/beansclient","commit_stats":{"total_commits":158,"total_committers":5,"mean_commits":31.6,"dds":0.1708860759493671,"last_synced_commit":"2125dcf1352452832f3f099cdca90d241dbe9154"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/xobotyi/beansclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xobotyi%2Fbeansclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xobotyi%2Fbeansclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xobotyi%2Fbeansclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xobotyi%2Fbeansclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xobotyi","download_url":"https://codeload.github.com/xobotyi/beansclient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xobotyi%2Fbeansclient/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260702681,"owners_count":23049311,"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":["beanstalk","beanstalkd","client","php","queue"],"created_at":"2024-10-28T23:07:48.792Z","updated_at":"2025-06-19T06:34:20.829Z","avatar_url":"https://github.com/xobotyi.png","language":"PHP","readme":"\u003cdiv align=\"center\"\u003e\n\n# beansclient\n\n[![NPM Version](https://flat.badgen.net/packagist/v/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient)\n[![NPM Downloads](https://flat.badgen.net/packagist/dt/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient)\n[![NPM Dependents](https://flat.badgen.net/packagist/dependents/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient)\n[![Build](https://img.shields.io/github/workflow/status/xobotyi/beansclient/CI?style=flat-square)](https://github.com/xobotyi/beansclient/actions)\n[![Coverage](https://flat.badgen.net/codecov/c/github/xobotyi/beansclient)](https://app.codecov.io/gh/xobotyi/beansclient)\n[![NPM Dependents](https://flat.badgen.net/packagist/php/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient)\n[![NPM Dependents](https://flat.badgen.net/packagist/license/xobotyi/beansclient)](https://packagist.org/packages/xobotyi/beansclient)\n\n\u003c/div\u003e\n\n## About\n\nBeansClient is a PHP8 client for [beanstalkd work queue](https://github.com/kr/beanstalkd) with thorough unit-testing.\nLibrary uses PSR-4 autoloader standard and always has 100% tests coverage.    \nLibrary gives you a simple way to provide your own Socket implementation, in cases when you need to log requests and\nresponses or to proxy traffic to non-standard transport.\n\nBeansClient supports whole bunch of commands and responses specified\nin [protocol](https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt) for version 1.12  \n\u003cbr\u003e\n\n## Why BeansClient?\n\n1. Well tested.\n2. Supports UNIX sockets.\n3. Actively maintained.\n4. Predictable (does not throw exception in any situation, hello `pheanstalk`🤪).\n5. PHP8 support.\n\n## Contents\n\n1. [Requirements](#requirements)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Docs](#docs)\n    * TBD\n\n## Requirements\n\n- [PHP](//php.net/) 8.0+\n- [beanstalkd](//github.com/kr/beanstalkd/) 1.12+\n\n## Installation\n\nInstall with composer\n\n```bash\ncomposer require xobotyi/beansclient\n```\n\n## Usage\n\n```php\n\u003c?php\nuse xobotyi\\beansclient\\Beanstalkd;\nuse xobotyi\\beansclient\\Client;\nuse xobotyi\\beansclient\\Socket\\SocketsSocket;\n\n$sock   = new SocketsSocket(host: 'localhost', port: 11300, connectionTimeout: 2);\n$client = new Client(socket: $sock, defaultTube: 'myAwesomeTube');\n\n##            ##\n#   PRODUCER   #\n##            ##\n\n$job = $client-\u003eput(\"job's payload\", delay: 2);\nif($job['state'] === Beanstalkd::JOB_STATE_DELAYED) {\n  echo \"Job {$job['id']} is ready to be reserved within 2 seconds\\n\";\n}\n\n##            ##\n#    WORKER    #\n##            ##\n\n$client-\u003ewatchTube('myAwesomeTube2');\n\n$job = $client-\u003ereserve();\n\nif ($job) {\n    echo \"Hey, i received first {$job['payload']} of job with id {$job['id']}\\n\";\n\n    $client-\u003edelete($job['id']);\n\n    echo \"And i've done it!\\n\";\n}\nelse {\n    echo \"So sad, i have nothing to do\";\n}\n\necho \"Am I still connected? \\n\" . ($client-\u003esocket()-\u003eisConnected() ? 'Yes' : 'No') . \"\\n\";\n```\n","funding_links":["https://patreon.com/xobotyi"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxobotyi%2Fbeansclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxobotyi%2Fbeansclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxobotyi%2Fbeansclient/lists"}