Haricot is a Beanstalk client for Lua.
Haricot does not decode the YAML data returned by the following methods:
- stats-job
- stats-tube
- stats
- list-tubes
- list-tubes-watched
It returns raw YAML. Use your own decoding library if needed.
Haricot only depends on LuaSocket or lsocket.
Tests require cwtest, a YAML parser such as tinyyaml, lyaml or the one from lubyk, both LuaSocket and lsocket and a running beanstalkd instance.
local haricot = require "haricot"
local bs = haricot.new("localhost", 11300)
bs:put(2048, 0, 60, "hello")
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)
See haricot.test.lua.
- Copyright (c) 2012-2013 Moodstocks SAS
- Copyright (c) 2014-2022 Pierre Chapuis