Skip to content

Commit

Permalink
Merge pull request #3131 from micalevisk/patch-1
Browse files Browse the repository at this point in the history
docs(fundamentals): clarify triggering behavior of init phases
  • Loading branch information
kamilmysliwiec authored Nov 4, 2024
2 parents c06acf4 + 61fb0a4 commit c07269c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/fundamentals/lifecycle-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The following diagram depicts the sequence of key application lifecycle events,

Lifecycle events happen during application bootstrapping and shutdown. Nest calls registered lifecycle hook methods on modules, providers and controllers at each of the following lifecycle events (**shutdown hooks** need to be enabled first, as described [below](https://docs.nestjs.com/fundamentals/lifecycle-events#application-shutdown)). As shown in the diagram above, Nest also calls the appropriate underlying methods to begin listening for connections, and to stop listening for connections.

In the following table, `onModuleInit` and `onApplicationBootstrap` are only triggered if you explicitly call `app.init()` or `app.listen()`.

In the following table, `onModuleDestroy`, `beforeApplicationShutdown` and `onApplicationShutdown` are only triggered if you explicitly call `app.close()` or if the process receives a special system signal (such as SIGTERM) and you have correctly called `enableShutdownHooks` at application bootstrap (see below **Application shutdown** part).

| Lifecycle hook method | Lifecycle event triggering the hook method call |
Expand Down

0 comments on commit c07269c

Please sign in to comment.