Permalink
Browse files

Wrap the code in a with-client call to avoid leaking connections

  • Loading branch information...
1 parent d9ffd1b commit 78ada1007fdff1633e62ee2ac4f71699daa7d1c1 @skuro skuro committed Nov 8, 2010
Showing with 6 additions and 5 deletions.
  1. +6 −5 sample.clj
View
@@ -1,8 +1,9 @@
(ns sample
(:require [http.async.client :as c]))
-(let [r (c/GET "http://example.com/")]
- (println "done?" (c/done? r))
- (c/await r)
- (println "done?" (c/done? r))
- (c/string r))
+(with-client
+ (let [r (c/GET "http://example.com/")]
+ (println "done?" (c/done? r))
+ (c/await r)
+ (println "done?" (c/done? r))
+ (c/string r)))

0 comments on commit 78ada10

Please sign in to comment.