1

来自http://immutant.org/documentation/current/apidoc/guide-installation.html的不变文档:

依赖关系到位后,您只需从应用程序的主入口点调用 Immutant 服务,该入口点由:main .project.clj

Immutant 的 Web 服务可以像这样调用:

(ns my-app.handler
  ...
  (:require [immutant.web :as web])
  ... )

(def app ... )

(defn -main [& args]
  (web/run app))

相当于(web/run app)什么immutant.messaging

4

1 回答 1

1

这是您开始排队的答案

(ns my-project.name
(:require [immutant.messaging :as msg]))

(defn call-fn
  [args]
  (let [fun (ns-resolve "namespace where fun defined" (symbol (first args)))
        params (rest args)]
    (if (seq params)
      (apply fun )
      (fun))))

(msg/start "queue")
(msg/respond "queue" (fn [args] (call-fn args)))

呼叫队列只是说

@(msg/request "queue" ["fun-name" params])
于 2015-04-01T11:25:57.490 回答