After 98 commits in about one month, I’m glad to announce [slacker "0.6.1"].
One thing in slacker 0.6.x is you can expose multiple namespaces from a single server.
Suppose you have two namespaces `redday.stats` and `redday.api`, both contains functions you want to expose.
This will expose `redday.stats` and `redday.api` on port 6565.
On the client side, we have a new `use-remote` behaviors like clojure’s use. Instead of local one, it imports functions from a remote namespace to your current namespace.
;; create a slacker client
(def scp (slackerc "127.0.0.1:6565"))
(use-remote 'scp 'redday.api) ;; caution, use the symbol of 'scp here
(use-remote 'scp 'redday.stats)
;;top-titles is a function in redday.api
;;now you can use the remote function transparently
;;check function metadata you can find more slacker properties
If you need to configure callback to a particular function, you can still use `defn-remote` to specify the callback function. In slacker 0.6.0, a `:remote-ns` is required when you define such a remote function.
The complete code example (both server and client) can be found here.
In next post, I will explain another big new feature of 0.6.x, cluster support.