Skip to content

Refactor ActionListener#map towards Stricter API#65526

Merged
original-brownbear merged 3 commits intoelastic:masterfrom
original-brownbear:better-map-listener
Dec 1, 2020
Merged

Refactor ActionListener#map towards Stricter API#65526
original-brownbear merged 3 commits intoelastic:masterfrom
original-brownbear:better-map-listener

Conversation

@original-brownbear
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 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