Skip to content

Minimalistic lambda-oriented method for consuming messages #247

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

Closed
michaelklishin opened this issue Feb 23, 2017 · 0 comments
Closed

Minimalistic lambda-oriented method for consuming messages #247

michaelklishin opened this issue Feb 23, 2017 · 0 comments

Comments

@michaelklishin
Copy link
Contributor

michaelklishin commented Feb 23, 2017

Now that master can require JDK 8 we can begin retrofitting the API to accept lambdas. For example, in some clients it's common to use lambdas as consumer delivery handlers. This is generally straightforward except for one case: cancellation handling and a single lambda
wouldn't work.

I propose that we add a Channel#basicConsume overload that accepts two lambdas instead of a Consumer instance:

  • A delivery handler
  • A cancellation handler
@michaelklishin michaelklishin added this to the 5.0.0 milestone Feb 23, 2017
@michaelklishin michaelklishin changed the title Minimalistic lambda-oriented consumers Minimalistic lambda-oriented method for consuming messages Feb 23, 2017
acogoluegnes added a commit that referenced this issue Feb 28, 2017
Only basic.deliver and basic.cancel callbacks are covered.
They're likely to be the most commonly used. This can provide
a straightforward syntax when callbacks are simple (e.g. one line).
The Delivery wrapper class from RpcServer has been extracted as
a top level class: it's used in the deliver callback to avoid
having a lambda with 4 parameters.

Fixes #247
acogoluegnes added a commit that referenced this issue Mar 1, 2017
acogoluegnes added a commit that referenced this issue Mar 1, 2017
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

1 participant