Skip to content

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

Merged
merged 4 commits into from
Jan 11, 2019
Merged

Introduce StepListener #37327

merged 4 commits into from
Jan 11, 2019

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jan 10, 2019

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.
@dnhatn dnhatn added >non-issue :Core/Infra/Core Core issues without another label v7.0.0 v6.7.0 labels Jan 10, 2019
@dnhatn dnhatn requested a review from s1monw January 10, 2019 19:46
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@jaymode jaymode left a 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?

@dnhatn
Copy link
Member Author

dnhatn commented Jan 11, 2019

@jaymode Thanks for looking. I have fixed the concurrency issue. Would you please have another look? Thank you!

A side note, some of the behavior is pretty similar to ListenableFuture so maybe that can be used/reused here?

Agreed, I'll look into this later.

@dnhatn dnhatn requested a review from jaymode January 11, 2019 04:00
@dnhatn
Copy link
Member Author

dnhatn commented Jan 11, 2019

@jaymode I pushed e9ed6e1 to reuse ListenableFuture.

Copy link
Contributor

@s1monw s1monw left a 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

@dnhatn
Copy link
Member Author

dnhatn commented Jan 11, 2019

I wonder if we can take advantage of this for instance in SyncedFlushService as a followup.

Good idea. I will do it.

Copy link
Member

@jaymode jaymode left a comment

Choose a reason for hiding this comment

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

LGTM

@dnhatn
Copy link
Member Author

dnhatn commented Jan 11, 2019

Thanks @jaymode and @s1monw for reviewing.

@dnhatn dnhatn merged commit 70cee18 into elastic:master Jan 11, 2019
@dnhatn dnhatn deleted the step-listener branch January 11, 2019 18:06
dnhatn added a commit that referenced this pull request Jan 12, 2019
This commit introduces StepListener which provides a simple way to write
a flow consisting of multiple asynchronous steps without having nested
callbacks.

Relates #37291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants