-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Introduce StepListener #37327
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
Introduce StepListener #37327
Conversation
This commit introduces StepListener which provides a simple way to write a flow consisting of multiple asynchronous steps without having nested callbacks.
Pinging @elastic/es-core-infra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what the thread safety is supposed to be but I don’t think it is right based on the implementation. A side note, some of the behavior is pretty similar to ListenableFuture so maybe that can be used/reused here?
server/src/main/java/org/elasticsearch/action/StepListener.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/StepListener.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/StepListener.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/StepListener.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/StepListener.java
Outdated
Show resolved
Hide resolved
@jaymode Thanks for looking. I have fixed the concurrency issue. Would you please have another look? Thank you!
Agreed, I'll look into this later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM I wonder if we can take advantage of this for instance in SyncedFlushService
as a followup
Good idea. I will do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit introduces StepListener which provides a simple way to write a flow consisting of multiple asynchronous steps without having nested callbacks. Relates #37291
This commit introduces StepListener which provides a simple way to write
a flow consisting of multiple asynchronous steps without having nested
callbacks.
Relates #37291