- ANN tags:
- clojure
- project published: true comments: true
Glad to roll out the first release of the slacker framework. Slacker is a clojure RPC framework on top of a TCP binary protocol. It provides a set of non-invasive APIs for both server and client. The remote invocation is completely transparent to user.
In addition to APIs introduced in last post, asynchronous approach is supported in client API :
[cc lang="clojure"]
(defremote remote-func :async true)
@(remote-func)
[/cc]
If you add option `:async` to defremote, then the function facade will return a promise. You have to deref it by yourself. Also you can use the `:callback` option in defremote to specify a callback function.
[cc lang="clojure"]
(defremote remote-func :callback #(println %))
(remote-func)
[/cc]
This gives you much more flexibility of using remote function. But be careful it will break consistency between local and remote mode.
To use slacker, add it to your project.clj
[cc lang="clojure"]
:dependencies [[info.sunng/slacker "0.1.0"]]
[/cc]
You can find examples on the github page.