File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change 1717 " Read messages from the input stream, put them on a channel."
1818 [input-stream]
1919 (let [chan (async/chan 1024 )]
20- ; ; TODO make these threads w/ loops, since they're handling IO
21- ; ; might explain the wierd drlog blockages
22- (async/go-loop
23- []
24- (when-let [msg (msgpack/unpack input-stream)]
25- (log/info " stream -> msg -> in chan: " msg)
26- (async/>! chan msg)
27- (recur )))
20+ (async/thread
21+ (loop []
22+ (when-let [msg (msgpack/unpack input-stream)]
23+ (log/info " stream -> msg -> in chan: " msg)
24+ (async/>!! chan msg)
25+ (recur ))))
2826 chan))
2927
3028(defn- write-msg!
3735 " Make a channel to read messages from, write to output stream."
3836 [output-stream]
3937 (let [chan (async/chan 1024 )]
40- (async/go-loop
41- []
42- (when-let [msg (async/<! chan)]
43- (log/info " stream <- msg <- out chan: " msg)
44- (write-msg! (msgpack/pack msg) output-stream)
45- (recur )))
38+ (async/thread
39+ ( loop []
40+ (when-let [msg (async/<! ! chan)]
41+ (log/info " stream <- msg <- out chan: " msg)
42+ (write-msg! (msgpack/pack msg) output-stream)
43+ (recur ) )))
4644 chan))
4745
4846; ; ***** Public *****
You can’t perform that action at this time.
0 commit comments