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

Change signature of RPCFuture.addCallback to allow lambdas as arguments #1732

Closed
viniciusccarvalho opened this issue Mar 10, 2017 · 2 comments
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@viniciusccarvalho
Copy link

Hi, it's nice to have a callback mechanism on the latest pubsub client library, but it would be even better if the RPCFuture.addCallback supported functional interfaces instead of an interface with two methods to process errors and success.

so if instead of addCallback(RpcFutureCallback)

public void subscribe(Consumer success, Consumer<? super Throwable> error){

One could just invoke the subscribe with lambdas expressions.

I know Consumer is Java 8 construct, but any functional interface with an interface like

Foo{

void apply(T t)

}

would work

@garrettjonesgoogle garrettjonesgoogle added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Mar 10, 2017
@garrettjonesgoogle
Copy link
Member

Unfortunately, we probably aren't going to do this. We are trying to match the patterns of ListenableFuture from Guava, which is well-established and widely understood. When we migrate to Java 8, we will fully use the available Java 8 constructs.

@garrettjonesgoogle
Copy link
Member

Closing out issue now - we appreciate your suggestions, keep them coming!

suztomo pushed a commit that referenced this issue Feb 1, 2023
…cp/templates/java_library/.kokoro (#1732) (#1057)

build(deps): bump certifi

Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <chingor@google.com>
Source-Link: https://github.com/googleapis/synthtool/commit/ae0d43e5f17972981fe501ecf5a5d20055128bea
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c
suztomo pushed a commit that referenced this issue Feb 1, 2023
…cp/templates/java_library/.kokoro (#1732) (#951)

build(deps): bump certifi

Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <chingor@google.com>
Source-Link: https://github.com/googleapis/synthtool/commit/ae0d43e5f17972981fe501ecf5a5d20055128bea
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c
suztomo pushed a commit that referenced this issue Feb 1, 2023
…cp/templates/java_library/.kokoro (#1732) (#572)

build(deps): bump certifi

Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <chingor@google.com>
Source-Link: https://github.com/googleapis/synthtool/commit/ae0d43e5f17972981fe501ecf5a5d20055128bea
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants