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

Documentation clarification regarding threads #27

Open
fegu opened this issue Sep 30, 2013 · 1 comment
Open

Documentation clarification regarding threads #27

fegu opened this issue Sep 30, 2013 · 1 comment

Comments

@fegu
Copy link
Contributor

fegu commented Sep 30, 2013

I'm sorry for raising this as an issue, perhaps the maintainer would prefer an email for future issues such as this?

A common minimum initial call sequence is
openConnection
openChannel
declareQueue
consumeMsgs

Some programs are multi-threaded. It should perhaps be pointed out that while this works fine:
forkIO $
openConnection
openChannel
declareQueue
consumeMsgs

and this works fine:
openConnection
forkIO $
openChannel
declareQueue
consumeMsgs

this just silently fails (no errors, just does not work):
openConnection
openChannel
forkIO $
declareQueue
consumeMsgs

The reason being, I suppose, that each channel gets its own thread by the amqp library. However, this consequence of the separate channel threads is not obvious from the documentation.

On a side note, after addConnectionClosedHandler was added in v0.2.7 and
qos in v0.4.0, it is now possible to make quite solid AMQP clients with this library.

@hreinhardt
Copy link
Owner

Issues are alright for these kinds of problems as they very well may point to a real bug in the library.

In this case I cannot reproduce your problem. I'm not sure how forkIO could lead to a problem here. Can you post an example test case?

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

2 participants