Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleep in consumer #18

Closed
carlhoerberg opened this issue Jun 23, 2013 · 6 comments
Closed

Sleep in consumer #18

carlhoerberg opened this issue Jun 23, 2013 · 6 comments

Comments

@carlhoerberg
Copy link

More of a question than an issue; seems like (Thread/sleep 10000) in a subscription handler returns immediately, is that right? In that case, why/how?

@michaelklishin
Copy link
Owner

No. How can Langohr affect behavior of JDK classes like Thread?

@carlhoerberg
Copy link
Author

I know Langohr doesn't do anything, more if you knew if ExecutorService did something to thread/sleep..

@ifesdjeen
Copy link
Collaborator

It may just look like that is happening. ExecutorService doesn't do anything to Thread/sleep, so it should work as expected.

Try using some logger (or rebinding out to stdout so that all the threads could println) and going through what's going on within your handler.

Maybe I misunderstood the question. So far, worked quite fine for me, let me know if that helps or if you have some more info or an example.

@carlhoerberg
Copy link
Author

yeah, no, that's what i'm doing, (println "a") (Thread/sleep 10000) (println "b"), but both a and b is printed to the log at the same time.. but ok, might be something else interfering then. thank you.

On Monday 24 June 2013 at 10:19, Alex P wrote:

It may just look like that is happening. ExecutorService doesn't do anything to Thread/sleep, so it should work as expected.
Try using some logger (or rebinding out to stdout so that all the threads could println) and going through what's going on within your handler.
Maybe I misunderstood the question. So far, worked quite fine for me, let me know if that helps or if you have some more info or an example.


Reply to this email directly or view it on GitHub (#18 (comment)).

@michaelklishin
Copy link
Owner

Consumer deliveries are dispatched to an executor which in theory may interrupt or otherwise wake up sleeping threads, although I haven't heard of anything like that. But a sleeping thread can be interrupted.

@carlhoerberg
Copy link
Author

when trying to isolate and replicate the behavior (which so far i'm unable to do so), i noticed that messages aren't processed in parallel, even with a custom ExecutorService (20 fixed threads), is that expected? (qos > 1)

On Tuesday 25 June 2013 at 11:12, Michael Klishin wrote:

Consumer deliveries are dispatched to an executor which in theory may interrupt or otherwise wake up sleeping threads, although I haven't heard of anything like that. But a sleeping thread can be interrupted.


Reply to this email directly or view it on GitHub (#18 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants