-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Triggers for newly introduced
serverWillStart
lifecycle hooks.
This commit follows-up on #1795, which introduced the new request pipeline, and implements the triggers for its new life-cycle hooks within the various integration packages. Previously, the only implementation was within the `apollo-server` package and didn't get triggered for those invoking the `applyMiddleware` method on integrations (e.g. `apollo-server-express`, `...-hapi` and `...-koa`). While in an ideal world, ALL existing `applyMiddleware` functions would be marked as `async` functions and allow us to `await ApolloServer#willStart`, in practice the only `applyMiddleware` which is currently `async` is the one within the Hapi implementation. Therefore, we'll instead kick off the `willStart` lifecycle hook as soon as `applyMiddleware` is started, return as quickly as we have before and then (essentially) yield the completion of Apollo Server's `willStart` prior to serving the first request — thus ensuring the completion of server-startup activities. Similarly, we'll do the same for `createHandler` methods on integrations which don't utilize Node.js server frameworks but don't have `async` handlers (e.g. AWS, Lambda, etc.).
- Loading branch information
Showing
7 changed files
with
85 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters