Skip to content
A simple beanstalkd client library for Clojure.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src/beanstalk_clj
test/beanstalk_clj
.gitignore
.travis.yml
LICENSE
README.md
project.clj

README.md

beanstalk-clj

Build Status

beanstalk-clj is a Clojure library for Beanstalkd.

Installation

To include beanstalk-clj in your project, simply add the following to your project.clj dependencies:

[beanstalk-clj "0.1.3"]

State

Although it's in an early state of development(beanstalk-clj API subject to change), beanstalk-clj has fully implemented beanstalkd protocol.

At the moment, you will have to look at the source once you've loaded beanstalk-clj up to get around the API. Documentation is coming soon.

Usage

basic REPL client declaration:

(def client (beanstalk-factory))

(def client (beanstalk-factory "localhost" 11300))

(def client (beanstalk-factory "localhost:11300"))

All queue operation accept a first argument indicating the client for that operation.

=> (put client "body")
1N
=> (reserve client)
#<Job beanstalk_clj.core.Job@3695149e>

You can optionally provide configuration using dynamic scope via with-beanstalkd:

=> (with-beanstalkd (beanstalkd-factory)
    (println (put "body")))
1N
=> (with-beanstalkd (beanstalkd-factory)
    (println (reserve)))
#<Job beanstalk_clj.core.Job@52dec7eb>

After reserved, delete job:

=> (with-beanstalkd (beanstalkd-factory)
    (let [job (reserve)]
     (delete job))

Documentations

License

Copyright © 2014 Lin Ju (soasme)

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

You can’t perform that action at this time.