Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Transparent, non-invasive RPC by clojure and for clojure

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


"Superman is a slacker."

slacker is a simple RPC framework for Clojure based on aleph and carbonite. I forked carbonite because slacker requires it to work on clojure 1.2.

slacker is growing.



:dependencies [[info.sunng/slacker "0.1.0"]]

Getting Started

Slacker will expose all your public functions under a given namespace.

(ns slapi)
(defn timestamp []

;; ...more functions

To expose slapi, use:

(use 'slacker.server)
(start-slacker-server (the-ns 'slapi) 2104)

On the client side, define a facade for the remote function:

(use 'slacker.client)
(def sc (slackerc "localhost" 2104)
(defremote sc timestamp)

Options in defremote

You are specify the remote function name when the name is occupied in current namespace

(defremote sc remote-time
  :remote-name "timestamp")

If you add an :async flag to defremote, then the facade will be asynchronous which returns a promise when you call it. You should deref it by yourself to get the return value.

(defremote timestamp :async true)

You can also assign a callback for an async facade.

(defremote timestamp :callback #(println %))

Serializing custom types

By default, most clojure data types are registered in carbonite. (As kryo requires you to register a class before you can serialize its instances.) However, you may have additional types to transport between client and server. To add your own types, you should register custom serializers on both server side and client side. Run this before you start server or client:

(use '[slacker common])
(register-serializers some-serializers)

Carbonite has some detailed docs on how to create your own serializers.


Copyright (C) 2011 Sun Ning

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

Something went wrong with that request. Please try again.