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

Can I use BasicConsume & BasicAck in different threads at the same time? #27

Closed
myheimu opened this issue Sep 20, 2012 · 1 comment
Closed

Comments

@myheimu
Copy link

myheimu commented Sep 20, 2012

Can I do this?

One Thread:
Envelope::ptr_t env;
while (true) {
channel->BasicConsumeMessage(consumer_tag, env, 0);
}

The Other Thread:
Envelope::ptr_t env_now = env;
channel->BasicAck(env_now);

@alanxz
Copy link
Owner

alanxz commented Sep 20, 2012

No. If you use a Channel object in different threads you must synchronize access to the Channel object.

@alanxz alanxz closed this as completed Sep 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants