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

Ensure that schema + source upgrades are reliably async #808

Merged
merged 3 commits into from Feb 9, 2021
Merged

Conversation

dgeb
Copy link
Member

@dgeb dgeb commented Feb 9, 2021

The goal of this PR is to ensure that a call to await schema.upgrade(settings) will complete by the time all listeners (i.e. typically sources that share this schema) have completed their upgrades (which may occur async).

Listeners are invoked with a new fulfillAll method for Evented objects, which uses Promise.all to fulfill any promises that may be returned by listeners.

A cleanup pass was also made on sources to ensure that they all provide an async upgrade method.

@dgeb dgeb force-pushed the schema-upgrades branch 2 times, most recently from 9d63184 to 2bb78a6 Compare February 9, 2021 20:38
`fulfillAll` will emit events and fulfill responses simultaneously via `Promise.all`. This is similar to (but different from) `fulfillInSeries`, which fulfills responses in order, one after the other.
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.

None yet

1 participant