Skip to content

golgote/haricot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haricot

Build Status

Presentation

Haricot is a Beanstalk 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-watched

It returns raw YAML. Use your own decoding library if needed.

Dependencies

Haricot only depends on LuaSocket.

Tests require cwtest, a YAML parser such as lyaml or the one from lubyk and a running beanstalkd instance.

Usage

Creating a job

local haricot = require "haricot"
local bs = haricot.new("localhost", 11300)
bs:put(2048, 0, 60, "hello")

Consuming a job

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-2016 Pierre Chapuis

About

Beanstalk client for Lua

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 82.6%
  • Shell 15.9%
  • Makefile 1.5%