vespa-crabro

easy distribution for clojure


License
EPL-1.0

Documentation

vespa-crabro

Description

  • dirt simple distributed message queues for clojure, built on hornetq

Usage

  • the client can vespa-crabro to your project.clj
[vespa-crabro "0.2.0"]
  • from the jar:
java -jar vespa-crabro-0.2.0-standalone.jar :host $HOSTNAME :port $PORT

will generate a .vespa-cookie you can use to connect to the server

  • from the repl:
(def server (create-server))
;=> #'vespa.crabro/server
(cookie server)
;=> ...
(def mb (message-bus))
;=> #'vespa.crabro/mb
(send-to mb "foo" {:a 1 :b 2})
;=> nil
(receive-from mb "foo" println)
;; {:a 1, :b 2}
;=> nil
(react-to mb "foo")
;=> #<AReactor@602703: nil>
(def r *1)
;=> #'vespa.crabro/r
(set-action r (fn [mb r state msg] msg))
;=> nil
(react! r)
;=> nil
r
;=> <AReactor@602703: nil>
(send-to mb "foo" 1)
;=> nil
r
;=> #<AReactor@602703: 1>
(send-to mb "foo" 2)
;=> nil
r
;=> #<AReactor@602703: 2>
  • the “cookie” is a clojure map of connection parameters. create-server will write the cookied to user.home and message-bus will read the cookie from there. create-server takes a number of options to configure the port and host, etc.

Logging

  • logging for the server logs to a ring buffer
  • vespa.logging/log

Todo

License

Copyright (C) 2012 Kevin Downey

Distributed under the Eclipse Public License, the same as Clojure.