From 07ba5977ef24e109df6627b3a4cc94b6b2eaea0c Mon Sep 17 00:00:00 2001 From: Alexey Date: Sun, 2 Jun 2024 19:05:14 +0700 Subject: [PATCH] Fix typos --- docs/docs/en/getting-started/lifespan/context.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/en/getting-started/lifespan/context.md b/docs/docs/en/getting-started/lifespan/context.md index 3dcee88b9f..5f32476ff7 100644 --- a/docs/docs/en/getting-started/lifespan/context.md +++ b/docs/docs/en/getting-started/lifespan/context.md @@ -10,7 +10,7 @@ search: # Lifespan Context Manager -Also, you can define *startup* and *shutdown* logic using the `lifespan` parameter of the **FastSTream** app, and a "context manager" (I'll show you what that is in a second). +Also, you can define *startup* and *shutdown* logic using the `lifespan` parameter of the **FastStream** app, and a "context manager" (I'll show you what that is in a second). Let's start with an example from [hooks page](./hooks.md#another-example){.internal-link} and refactor it using "context manager". @@ -21,7 +21,7 @@ We create an async function `lifespan()` with `#!python yield` like this: As you can see, `lifespan` parameter is much suitable for case (than `#!python @app.on_startup` and `#!python @app.after_shutdown` separated calls) if you have object needs to process at application startup and shutdown both. !!! tip - `lifespan` starts **BEFORE** your broken started (`#!python @app.on_startup` hook) and **AFTER** broker was shutdown (`#!python @app.after_shutdown`), so you can't publish any messages here. + `lifespan` starts **BEFORE** your broker started (`#!python @app.on_startup` hook) and **AFTER** broker was shutdown (`#!python @app.after_shutdown`), so you can't publish any messages here. If you want to make some actions will *already/still running broker*, please use `#!python @app.after_startup` and `#!python @app.on_shutdown` hooks.