Liking cljdoc? Tell your friends :D

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)
nil

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)))
nil

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.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close