This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-13
Channels
- # arachne (2)
- # architecture (23)
- # bangalore-clj (5)
- # beginners (35)
- # boot (79)
- # cider (6)
- # cljs-dev (34)
- # cljsrn (9)
- # clojure (164)
- # clojure-argentina (2)
- # clojure-austin (4)
- # clojure-italy (7)
- # clojure-russia (40)
- # clojure-serbia (1)
- # clojure-spec (76)
- # clojure-uk (36)
- # clojurescript (47)
- # cursive (14)
- # datascript (2)
- # datomic (8)
- # dirac (19)
- # emacs (29)
- # heroku (7)
- # hoplon (35)
- # jobs-rus (1)
- # juxt (2)
- # leiningen (1)
- # lumo (23)
- # mount (4)
- # off-topic (22)
- # om (16)
- # onyx (19)
- # parinfer (10)
- # pedestal (47)
- # proton (5)
- # re-frame (88)
- # rum (1)
- # spacemacs (33)
- # sql (29)
- # uncomplicate (1)
- # unrepl (131)
- # untangled (5)
- # yada (12)
gey guys, does anybody have a BlockingQueue in Java that mimics the behaviour a blocking consumer in a thread with a go-loop + recur?
i would like to block the sender until the receiver takes the item from a queue and processes it (i guess with while (true) {} instead of go-loop)
I don't understand...blocking queue does that, doesn't it? I if you call put
it blocks until there is room in the queue
(thread
(go-loop []
(let [ message (blocking-consumer work-chan)
(process message)
(recur))))
I'm not sure why you nested a go-loop
inside a thread
use one or the other, there's no reason to use both.
and if blocking-consumer is blocking, you shouldn't do that in a go-loop
. So I'm really confused as to what you're trying to accomplish given what you're asking.
maybe I just need more information
um...using a go-loop inside a thread has never been a good idea, nor a suggested approach
go-loop creates a callback that is run in another thread. thread
creates a thread that runs the body. So it's redundant.