https://github.com/catwell/haricot
Beanstalk client for Lua
https://github.com/catwell/haricot
beanstalkd lua
Last synced: 4 months ago
JSON representation
Beanstalk client for Lua
- Host: GitHub
- URL: https://github.com/catwell/haricot
- Owner: catwell
- License: mit
- Created: 2012-09-25T17:12:30.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2023-07-24T08:25:31.000Z (about 2 years ago)
- Last Synced: 2025-06-11T16:38:16.447Z (4 months ago)
- Topics: beanstalkd, lua
- Language: Lua
- Homepage:
- Size: 43 KB
- Stars: 28
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Haricot

## Presentation
Haricot is a [Beanstalk](https://beanstalkd.github.io/) client for Lua.
## Note about YAML
Haricot does not decode the YAML data returned by the following methods:
- stats-job
- stats-tube
- stats
- list-tubes
- list-tubes-watchedIt returns raw YAML. Use your own decoding library if needed.
## Dependencies
Haricot only depends on LuaSocket or lsocket.
Tests require [cwtest](https://github.com/catwell/cwtest), a YAML parser such as
[tinyyaml](https://luarocks.org/modules/membphis/lua-tinyyaml), [lyaml](https://github.com/gvvaughan/lyaml) or [the one from lubyk](https://github.com/lubyk/yaml/), both LuaSocket and lsocket and a running beanstalkd instance.## Usage
### Creating a job
```lua
local haricot = require "haricot"
local bs = haricot.new("localhost", 11300)
bs:put(2048, 0, 60, "hello")
```### Consuming a job
```lua
local haricot = require "haricot"
local bs = haricot.new("localhost", 11300)
local ok, job = bs:reserve(); assert(ok, job)
local id, data = job.id, job.data
print(data) -- "hello"
bs:delete(id)
```### More
See haricot.test.lua.
## Copyright
- Copyright (c) 2012-2013 Moodstocks SAS
- Copyright (c) 2014-2022 Pierre Chapuis