-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
🌐 Add Chinese translation for docs/zh/docs/advanced/events.md
#12512
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
Conversation
📝 Docs preview for commit 020a16f at: https://4fc6775f.fastapitiangolo.pages.dev Modified Pages |
docs/zh/docs/advanced/events.md
docs/zh/docs/advanced/events.md
Outdated
只是为好奇者提供的技术细节。🤓 | ||
|
||
在底层,这部分是<a href="https://asgi.readthedocs.io/en/latest/specs/lifespan.html" class="external-link" target="_blank">生命周期协议</a>的一部分,参见 ASGI 技术规范,定义了称为启动(`startup`)和关闭(`shutdown`)的事件。 | ||
|
||
/// info | "说明" | ||
|
||
有关事件处理器的详情,请参阅 <a href="https://www.starlette.io/events/" class="external-link" target="_blank">Starlette 官档 - 事件</a>。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.starlette.io/events/
这个地址也需要修改,改为https://www.starlette.io/lifespan/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YGuang233 你说得对,谢谢你的指正。我会修改这个错误。
📝 Docs preview for commit ae035e2 at: https://01582b6c.fastapitiangolo.pages.dev Modified Pages |
但在我们上面的例子里,我们并不是直接使用,而是传递给 FastAPI 来供其使用。 | ||
|
||
`FastAPI()` 的 `lifespan` 参数接受一个**异步上下文管理器**,所以我们可以把我们新定义的上下文管理器 `lifespan` 传给它。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
相较英文文档,此处缺少了一个传入lifespan参数的示例代码块
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你说得对,谢谢你的指正。我会修改这个错误。
📝 Docs preview for commit 1883c59 at: https://66ee39b1.fastapitiangolo.pages.dev Modified Pages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
📝 Docs preview for commit 5064771 at: https://7501cedc.fastapitiangolo.pages.dev Modified Pages |
📝 Docs preview for commit 2d18b2a at: https://f057b3fc.fastapitiangolo.pages.dev Modified Pages |
Thank you! @ZhibangYue 🚀 |
Add Chinese translation for docs/zh/docs/advanced/events.md
为【事件:启动 - 关闭】一章进行了更新,使之与英文最新版同步。