Permalink
Browse files

reverting Thread usage, back to agents

  • Loading branch information...
1 parent f69d7d2 commit 6088bbe695d6ca40aef23b402df23371541e04da root committed Oct 15, 2009
Showing with 15 additions and 13 deletions.
  1. +8 −7 src/org/runa/swarmiji/client/client_core.clj
  2. +7 −6 src/org/runa/swarmiji/mpi/sevak_proxy.clj
@@ -40,17 +40,18 @@
(attribute-from-response sevak-data :sevak-name))
(defn disconnect-proxy [sevak-proxy]
- (let [chan (:channel sevak-proxy) queue (:queue sevak-proxy) thread (:thread sevak-proxy)]
+; (let [chan (:channel sevak-proxy) queue (:queue sevak-proxy) thread (:thread sevak-proxy)]
+ (let [chan (:channel sevak-proxy) queue (:queue sevak-proxy)]
(try
(with-swarmiji-bindings
(.queueDelete chan queue)
- (catch Exception e))
+ (catch Exception e)))))
;no-op, this sevak-proxy should be aborted, thats it
- (finally
- (if (.isAlive thread)
- (do
- (log-message "Force interrupt!")
- (.interrupt thread)))))))
+; (finally
+; (if (.isAlive thread)
+; (do
+; (log-message "Force interrupt!")
+; (.interrupt thread)))))))
(defn on-swarm [sevak-service & args]
(log-message "On-swarm!")
@@ -24,7 +24,7 @@
(defn register-callback [return-q-name custom-handler]
(let [chan (*rabbitmq-multiplexer* :new-channel)
- wait-for-message (fn []
+ wait-for-message (fn [_]
(with-swarmiji-bindings
(try
(with-open [channel chan]
@@ -39,13 +39,14 @@
(log-message "closed channel" return-q-name)))))
(catch InterruptedException ie
(log-message "Encountered forced sevak-termination!")
- (log-exception ie))))
- thread (Thread. wait-for-message)]
+ (log-exception ie))))]
+ ;thread (Thread. wait-for-message)]
(log-message "got new channel:" (.hashCode chan) "now calling wait-for-message")
- ;(send-off (agent :_ignore_) wait-for-message)
- (.start thread)
+ (send-off (agent :_ignore_) wait-for-message)
+ ;(.start thread)
(log-message "called wait-for-message")
- {:channel chan :queue return-q-name :thread thread}))
+ ;{:channel chan :queue return-q-name :thread thread}))
+ {:channel chan :queue return-q-name}))
(defn new-proxy [sevak-service args callback-function]
(let [request-object (sevak-queue-message sevak-service args)

0 comments on commit 6088bbe

Please sign in to comment.