Skip to content

Refactor ActionListener#map towards Stricter API #65526

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

Merged

Conversation

original-brownbear
Copy link
Contributor

Making #map look and feel a little nicer, optimize chains of #map,
and replace #delegateFailure calls with #map calls where possible
in order to enforce callbacks not throwing where possible.

Making `#map` look and feel a little nicer, optimize chains of `#map`,
and replace `#delegateFailure` calls with `#map` calls where possible
in order to enforce callbacks not throwing where possible.
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Nov 26, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nit

return new MappedActionListener<>(fn, this);
}

final class MappedActionListener<Response, O> implements ActionListener<Response> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a more descriptive type name than "O"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@original-brownbear
Copy link
Contributor Author

Thanks Ryan!

@original-brownbear original-brownbear merged commit 4547d3b into elastic:master Dec 1, 2020
@original-brownbear original-brownbear deleted the better-map-listener branch December 1, 2020 02:00
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Dec 1, 2020
Making `#map` look and feel a little nicer, optimize chains of `#map`,
and replace `#delegateFailure` calls with `#map` calls where possible
in order to enforce callbacks not throwing where possible.
original-brownbear added a commit that referenced this pull request Dec 1, 2020
Making `#map` look and feel a little nicer, optimize chains of `#map`,
and replace `#delegateFailure` calls with `#map` calls where possible
in order to enforce callbacks not throwing where possible.
DaveCTurner added a commit that referenced this pull request Dec 2, 2020
PRs #65601 and #65526 conflict semantically, but not syntactically, so
this was not detected at merge time.
@original-brownbear original-brownbear restored the better-map-listener branch December 6, 2020 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants