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

Experimental event API - wrap async dispatched events #15299

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Apr 2, 2019

This PR fixes an issue where async dispatched events from event modules were not properly handled. Previously, before the refactor PR, async events were never batched together.

To ensure they such events are batched together, the context creates a new event queue for async events and then restores the old event queue upon completion. To do this a new method on context is introduced, specifically withAsyncDispatching. This method ensures that all async events inside the callback are properly batched together without conflicting with previous event queues. This also simplifies event queues, where previously they had the notion of phases (which isn't necessary now).

@necolas to follow up with tests.

Ref #15257

@trueadm trueadm merged commit 38fa840 into facebook:master Apr 3, 2019
@trueadm trueadm deleted the batch-async-events branch April 3, 2019 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants