slacker.server
slacker-ring-app
(slacker-ring-app fn-coll & {:keys [interceptors], :or {interceptors interceptor/default-interceptors}})Wrap slacker as a ring async app that can be deployed to any ring adaptors. You can also configure interceptors just like start-slacker-server
start-slacker-server
(start-slacker-server fn-coll port & {:keys [http interceptors ssl-context threads queue-size executor executors], :or {interceptors interceptor/default-interceptors, threads 10, queue-size 3000, executor nil, executors {}}, :as options})Start a slacker server to expose all public functions under a namespace, or a map or functions. If you have multiple namespace or map to expose, put fn-coll as a vector.
fn-coll examples:
(the-ns 'slacker.example.api): expose all public functions underslacker.example.api, except those marked with^:no-slacker{"slacker.example.api2" {"echo2 " (fn [a] a) ...}}expose all functions in this map[(the-ns 'slacker.example.api) {...}]a vector of normal function collection
Options:
interceptorsadd server interceptorsHttpHttp port for slacker http transportssl-contextthe SSLContext object for enabling tls supportexecutorcustom java.util.concurrent.ExecutorService for tasks execution, note this executor will be shutdown when you stop the slacker serverthreadssize of thread pool if no executor providedqueue-sizesize of thread pool task queue if no executor providedexecutorsa map of dedicated executors, key by namespace. You can configure dedicated thread pool for certain namespace.