       (wamp/http-kit-handler channel
                              {:on-call {service-rpc-uri (partial service-run-rpc method)}
                               :on-subscribe {service-status-uri true}
-                              :on-publish {service-status-uri true
-                                           (str service-status-uri "pub-only") true}}))))
+                              :on-publish {service-status-uri true}}))))

(def service-rpc-uri (str base "rpc#"))
(def service-status-uri (str base "status#"))

(defn dispatch
  [method data]
  (let [{:keys [updates close results]} (service/publish method data)]
    (go (loop [update (<! updates)]

              (recur (<! updates))))))
    (try @results
         (catch Exception e
           {:error {:uri service-rpc-uri
                    :message (.getMessage e)}}))))

(defn service-run-rpc [method data]
  (if (service/available? method)
    (dispatch-rpc method data)
    {:error {:uri service-rpc-uri
             :message (str "service " method " not avaiable")}}))

