     (trace (format "ENTER:run-worker %s" endpoint))
     (.connect (z/setup-socket fh) endpoint)
     (f/forever
-     (let [item (.poll queue 1 s)]
+     (let [item (.take queue)]
        (when item (z/sendmulti fh (evaluate worker item)))))))
 
 (defn fork-worker [ctx endpoint queue worker]

(defn make-queue [size]
  (java.util.concurrent.LinkedBlockingQueue. size))

(defn enqueue [fh queue]
  (let [[peer [blank & msg]] (split-with #(not (empty? %)) (z/recvmulti fh))]
    (when (empty? blank)
      (.put queue [peer msg]))))

(defn routing-loop [ifh ofh queue]
  (let [[ifh-info ofh-info] (z/poll -1 [ifh [ZMQ$Poller/POLLIN] ofh [ZMQ$Poller/POLLIN]])]
    (when (.isReadable ifh-info)
      (enqueue ifh queue))
    (when (.isReadable ofh-info)
      (z/sendmulti ifh (z/recvmulti ofh)))))

(defn evaluate [worker [peer msg]]
  (try
    (let [reply ((:onjob worker) msg)]
      (debug (format "REQUEST/DONE: %s ~> %s" (pr-str (map f/bytes-to-str-unsafe msg)) (pr-str reply)))
      (concat peer (cons "" reply)))
    (catch Exception e
      (let [reply (:onerr worker)]
        (error e (format "REQUEST/FAIL: %s ~> %s" (pr-str (map f/bytes-to-str-unsafe msg)) (pr-str reply)))
        (concat peer (cons "" reply))))))

(defn run-worker [ctx endpoint queue worker]

      (.bind (z/setup-socket ofh) ipcendpoint)
      (.bind (z/setup-socket ifh) (:endpoint cfg))
      (dotimes [_ (:capabilities cfg)] (fork-worker ctx ipcendpoint queue worker))
      (f/supervise (routing-loop ifh ofh queue worker))))
  (trace "EXIT:router-start1"))

(defmacro router-start [ctx worker cfg]
