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

Returning result of consumer callback #103

Closed
3DFace opened this issue Sep 24, 2013 · 3 comments
Closed

Returning result of consumer callback #103

3DFace opened this issue Sep 24, 2013 · 3 comments

Comments

@3DFace
Copy link

3DFace commented Sep 24, 2013

When I call $channel->wait() it calls consumer callback in such call chain:

return AbstractChannel->dispatch
return AMQPChannel->basic_deliver

'basic_deliver' just calls 'call_user_func', but it doesn't returns a result of that call.

It would be nice to add 'return' statement. Then it would be possible to write:

$callback_result = $channel->wait();

@videlalvaro
Copy link
Collaborator

$channel->wait(); isn't only there for basic_deliver. There are more things that happen inside, like waiting for other AMQP methods.

@3DFace
Copy link
Author

3DFace commented Sep 24, 2013

Yes, I realize that it's not just for 'basic_deliver'. Nevertheless, it returns the result of the dispatched method. So I supposed that result can be used somehow by 'wait' caller. Or you mean, that while waiting for 'basic_deliver' result I can get the result of another method? And 'return' statements in 'wait' just break the func execution?

@videlalvaro
Copy link
Collaborator

You call wait() to wait on the channel while it reads data from the network. In case of basic.deliver, you will have the callback to do something with the data received. Else, it just there to break the execution. As far as I can see this now, wait() is not going to return anything.

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