{"id":17089201,"url":"https://github.com/mariuswilms/beanstalk","last_synced_at":"2025-04-04T15:11:47.600Z","repository":{"id":56963481,"uuid":"1430071","full_name":"mariuswilms/beanstalk","owner":"mariuswilms","description":"Minimalistic PHP client for beanstalkd without any dependencies","archived":false,"fork":false,"pushed_at":"2018-05-05T09:13:52.000Z","size":63,"stargazers_count":199,"open_issues_count":1,"forks_count":59,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-28T14:11:26.161Z","etag":null,"topics":["beanstalkd","client","library","php"],"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/mariuswilms.png","metadata":{"files":{"readme":"README","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":"2011-03-02T10:08:10.000Z","updated_at":"2025-01-13T21:55:30.000Z","dependencies_parsed_at":"2022-08-21T05:40:25.447Z","dependency_job_id":null,"html_url":"https://github.com/mariuswilms/beanstalk","commit_stats":null,"previous_names":["davidpersson/beanstalk"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariuswilms%2Fbeanstalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariuswilms%2Fbeanstalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariuswilms%2Fbeanstalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariuswilms%2Fbeanstalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariuswilms","download_url":"https://codeload.github.com/mariuswilms/beanstalk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198469,"owners_count":20900081,"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","client","library","php"],"created_at":"2024-10-14T13:46:03.094Z","updated_at":"2025-04-04T15:11:47.579Z","avatar_url":"https://github.com/mariuswilms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nBEANSTALK\n---- Minimalistic PHP client for beanstalkd.\n\nSynopsis\n--------\nThis library allows you to interface with the beanstalkd[1] work queue and is\nbuilt with a minimal featureset still supporting the complete protocol. The\nmain (and currently only) class can be found at `src/Client.php`.\n\nThe class was formerly part of the queue plugin for CakePHP[2]. It has been\nextracted for higher reusability in other places and frameworks.\n\nCute[3] is such a project. It uses this library to provide convenient\naccess and tooling around the work queue for PHP.\n\n[1] http://kr.github.com/beanstalkd\n[2] https://github.com/davidpersson/queue\n[3] https://github.com/atelierdisko/cute_php\n\nCopyright \u0026 License\n-------------------\nBeanstalk, a beanstalk PHP client library for the beanstalkd work queue is\nCopyright (c) 2009-2015 David Persson if not otherwise stated. The code\nis distributed under the terms of the MIT License. For the full license\ntext see the LICENSE file.\n\nVersions \u0026 Requirements\n-----------------------\n1.0.0, PHP \u003e=5.2.1\n1.1.0, PHP \u003e=5.2.1\n2.0.0, PHP \u003e=5.4.1\n\nNote: In PHP Versions 5.3.9, 5.3.10 and 5.4.0 the `stream_get_line()`\n      function exhibits buggy behavior (PHP bug #60817), thus\n      these versions cannot be used with this library.\n\nInstallation\n------------\nThe preferred installation method is via composer. You can add the library\nas a dependency via:\n\n$ composer require davidpersson/beanstalk\n\nUsage\n-----\n\u003c?php\n\nuse Beanstalk\\Client;\n\n//\n// A sample producer.\n//\n$beanstalk = new Client(); // For connection options see the\n                           // class documentation.\n\n$beanstalk-\u003econnect();\n$beanstalk-\u003euseTube('flux'); // Begin to use tube `'flux'`.\n$beanstalk-\u003eput(\n    23, // Give the job a priority of 23.\n    0,  // Do not wait to put job into the ready queue.\n    60, // Give the job 1 minute to run.\n    '/path/to/cat-image.png' // The job's body.\n);\n$beanstalk-\u003edisconnect();\n\n//\n// A sample consumer.\n//\n$beanstalk = new Client();\n\n$beanstalk-\u003econnect();\n$beanstalk-\u003ewatch('flux');\n\nwhile (true) {\n    $job = $beanstalk-\u003ereserve(); // Block until job is available.\n    // Now $job is an array which contains its ID and body:\n    // ['id' =\u003e 123, 'body' =\u003e '/path/to/cat-image.png']\n\n    // Processing of the job...\n    $result = touch($job['body']);\n\n    if ($result) {\n        $beanstalk-\u003edelete($job['id']);\n    } else {\n        $beanstalk-\u003ebury($job['id']);\n    }\n}\n// When exiting i.e. on critical error conditions\n// you may also want to disconnect the consumer.\n// $beanstalk-\u003edisconnect();\n\n?\u003e\n\nRunning the Tests\n-----------------\nThe integration tests contained in this library require a running beanstalkd\ninstance. You'll need to start a dedicated instance on port 11301 as follows.\n\n```\nbeanstalkd -VV -l 127.0.0.1 -p 11301\n```\n\nTests for this library are PHPUnit based. To run the tests you'll need\nto have PHPUnit installed[1]. Following commands will run all the tests.\n\n```\ncd /path/to/beanstalk\ncomposer install\n\nexport TEST_BEANSTALKD_HOST=127.0.0.1\nexport TEST_BEANSTALKD_PORT=11301\nvendor/bin/phpunit tests\n```\n\n[1] http://www.phpunit.de/manual/current/en/installation.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariuswilms%2Fbeanstalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariuswilms%2Fbeanstalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariuswilms%2Fbeanstalk/lists"}