Skip to content

Commit

Permalink
add macro to manage subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
cbilson committed May 11, 2013
1 parent 37a87a3 commit 735c578
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ib_re_actor/gateway.clj
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@
(send-off listeners
(fn [fns] (filter (partial not= f) fns))))

(defmacro with-subscription [handler & body]
`(try
(g/subscribe ~handler)
~@body
(finally
(g/unsubscribe ~handler))))

(defn get-order-id []
(swap! next-order-id inc))

Expand Down

0 comments on commit 735c578

Please sign in to comment.