Skip to content

A simple beanstalkd client library for Clojure.

License

Notifications You must be signed in to change notification settings

pixelated-noise/beanstalk-clj

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple beanstalkd client library for Clojure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 100.0%