Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 project.clj
Octocat-spinner-32 readme.md
readme.md

Twine

A Clojure client library to the Beanstalkd queueing daemon.

Usage

; require twine
(require '[twine.client :as twine])

; producer puts jobs on a queue
(def twp (twine/init))
(twine/use twp "jobs")
(twine/put twp "hello worker")

; consumer works jobs off a queue
(def twc (twine/init))
(twine/watch twc "jobs")
(let [{:keys [id data]} (twine/reserve twc)]
  (println "reserved" id "with" data)
  (twine/delete twc id))

; observer checks stats
(def two (twine/init))
(twine/stats two)
(twine/stats-tube two "jobs")

The library implements all of the Beanstalkd commands; functions in this library are named after the commands.

Installation

Depend on [twine "0.0.1"] in your project.clj.

See also

The companion project Spine provides a higher-level enqueue / work interface that will be more appropriate for many applications.

Something went wrong with that request. Please try again.