2015-04-01 109 views

回答

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])