Skip to content

docs(hooks): show preClose flag to stop new plugin work - #7085

Open
lazerg wants to merge 2 commits into
fastify:mainfrom
lazerg:docs/preclose-stop-new-work
Open

lazerg wants to merge 2 commits into
fastify:mainfrom
lazerg:docs/preclose-stop-new-work

Conversation

@lazerg

@lazerg lazerg commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Adds a short example under preClose in the Hooks reference showing how a plugin can keep a local flag to stop starting new optional background work once fastify.close() has begun. It also notes that the flag doesn't cancel work already running, and that it's scoped to the plugin that owns it.

Closes #7083

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document using preClose to stop starting new plugin work during shutdown

1 participant