{"id":13697888,"url":"https://github.com/smallfish/lua-resty-beanstalkd","last_synced_at":"2026-03-17T14:11:04.738Z","repository":{"id":5211690,"uuid":"6387543","full_name":"smallfish/lua-resty-beanstalkd","owner":"smallfish","description":"non-blocking beanstalkd client lib for ngx_lua","archived":false,"fork":false,"pushed_at":"2021-12-18T02:10:57.000Z","size":48,"stargazers_count":59,"open_issues_count":1,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-26T13:40:31.502Z","etag":null,"topics":["beanstalkd","lua","ngx-lua"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jrimum/bopepo","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallfish.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}},"created_at":"2012-10-25T13:18:26.000Z","updated_at":"2024-08-25T18:51:41.000Z","dependencies_parsed_at":"2022-08-29T09:11:21.811Z","dependency_job_id":null,"html_url":"https://github.com/smallfish/lua-resty-beanstalkd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallfish%2Flua-resty-beanstalkd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallfish%2Flua-resty-beanstalkd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallfish%2Flua-resty-beanstalkd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallfish%2Flua-resty-beanstalkd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallfish","download_url":"https://codeload.github.com/smallfish/lua-resty-beanstalkd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252252662,"owners_count":21718765,"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","lua","ngx-lua"],"created_at":"2024-08-02T18:01:04.563Z","updated_at":"2025-12-18T11:23:41.157Z","avatar_url":"https://github.com/smallfish.png","language":"Raku","readme":"Name\n====\n\nlua-resty-beanstalkd - non-blocking beanstalkd lib for ngx_lua.\n\n[![Build Status](https://api.travis-ci.org/smallfish/lua-resty-beanstalkd.png)](https://travis-ci.org/smallfish/lua-resty-beanstalkd)\n\n\nStatus\n======\n\nThis library is considered experimental and still under active development.\n\nThe API is still in flux and may change without notice.\n\nDescription\n===========\n\nThis library requires an nginx, the [ngx_lua module](http://wiki.nginx.org/HttpLuaModule)\n\nCommands\n========\n\nAll beanstalkd commands are supported, following the name convention below:\n* The command name is the method name, with `-` replaced by `_`.\n* The arguments of such method are the arguments of corresponding command.\nFor instance, call `bean:stats_tube(tube)` is equal to send `stats-tube tube` to beanstalkd.\n\nFor more details, please see the below Synopsis section.\n\nSynopsis\n========\n\n```nginx\n    lua_package_path \"/path/to/lua-resty-beanstalkd/lib/?.lua;;\";\n\n    server {\n        location /test {\n        \n            content_by_lua_block {\n                local beanstalkd = require 'resty.beanstalkd'\n\n                -- new and connect\n                local bean, err = beanstalkd:new()\n                if not bean then\n                    ngx.say(\"failed to init beanstalkd:\", err)\n                    return\n                end\n                ngx.say(\"initialized ok\")\n\n                local ok, err = bean:connect()\n                if not ok then\n                    ngx.say(\"failed to connect beanstalkd:\", err)\n                    return\n                end\n                ngx.say(\"connect ok\")\n\n                -- use tube\n                local ok, err = bean:use(\"smallfish\")\n                if not ok then\n                    ngx.say(\"failed to use tube:\", err)\n                end\n                ngx.say(\"use smallfish tube ok\")\n\n                -- put job\n                local id, err = bean:put(\"hello\")\n                if not id then\n                    ngx.say(\"failed to put hello to smallfish tube, error:\", err)\n                end\n                ngx.say(\"put hello to smallfish tube, id:\", id)\n\n                -- watch tube\n                local ok, err = bean:watch(\"smallfish\")\n                if not ok then\n                    ngx.say(\"failed to watch tube smallfish, error:\", err)\n                    return\n                end\n                ngx.say(\"watch smallfish tube ok, tube size:\", ok)\n\n                -- reserve job,with optional timeout in seconds. reserve(timeout?)\n                local id, data = bean:reserve()\n                if not id then\n                    ngx.say(\"reserve hello failed, error:\", id, data)\n                else\n                    ngx.say(\"reserve hello ok, id:\", id, \"data:\", data)\n                end\n\n                -- release job\n                local ok, err = bean:release(id)\n                if not ok then\n                    ngx.say(\"failed to release, id:\", id, \" error:\", err)\n                else\n                    ngx.say(\"release ok, id:\", id)\n                end\n\n                local id, data = bean:reserve()\n                if not id then\n                    ngx.say(\"reserve hello failed, error:\", id, data)\n                else\n                    ngx.say(\"reserve hello ok, id:\", id, \" data:\", data)\n                end\n\n                -- peek job\n                local id, data = bean:peek(id)\n                if not id then\n                    ngx.say(\"peek failed, id not found\")\n                else\n                    ngx.say(\"peek ok, data:\", data)\n                end\n\n                -- bury job\n                local ok, err = bean:bury(id)\n                if not ok then\n                    ngx.say(\"bury failed, id:\", id, \" error:\", err)\n                else\n                    ngx.say(\"bury ok, id:\", id)\n                end\n\n                -- kick job\n                local count, err = bean:kick(1)\n                if not count then\n                    ngx.say(\"kick failed, error:\", err)\n                else\n                    ngx.say(\"kick ok, count:\", count)\n                end\n\n                local id, data = bean:reserve()\n                if not id then\n                    ngx.say(\"reserve hello failed, error:\", id, data)\n                else\n                    ngx.say(\"reserve hello ok, id:\", id, \" data:\", data)\n                end\n\n                -- delete job\n                local ok, err = bean:delete(id)\n                if ok then\n                    ngx.say(\"delete ok, id:\", id)\n                else\n                    ngx.say(\"delete failed, id:\", id, ok, err)\n                end\n\n                -- put it into the connection pool of size 100,\n                -- with 0 idle timeout\n\n                bean:set_keepalive(0, 100)\n\n                -- close and quit beanstalkd\n                -- bean:close()\n            }\n\n        }\n    }\n```\n\nAuthor\n======\n\nChen \"smallfish\" Xiaoyu (陈小玉) \u003csmallfish.xy@gmail.com\u003e\n\nCopyright and License\n=====================\n\nThis module is licensed under the BSD license.\n\nCopyright (C) 2012, by Chen \"smallfish\" Xiaoyu (陈小玉) \u003csmallfish.xy@gmail.com\u003e\n\nPortions of the code are from [lua-resty-memcached](https://github.com/agentzh/lua-resty-memcached) Copyright (C) 2012, by Zhang \"agentzh\" Yichun (章亦春) \u003cagentzh@gmail.com\u003e.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nSee Also\n========\n* [ngx_lua module](http://wiki.nginx.org/HttpLuaModule)\n* [beanstalkd protocol specification](https://github.com/kr/beanstalkd/blob/master/doc/protocol.txt)\n* [lua-resty-memcached](https://github.com/agentzh/lua-resty-memcached)\n* [lua-resty-redis](https://github.com/agentzh/lua-resty-redis)\n* [lua-resty-mysql](https://github.com/agentzh/lua-resty-mysql)\n","funding_links":[],"categories":["Third Modules","Rust Modules"],"sub_categories":["C Modules","Lua Modules"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallfish%2Flua-resty-beanstalkd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallfish%2Flua-resty-beanstalkd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallfish%2Flua-resty-beanstalkd/lists"}