mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-15 01:59:10 +02:00
Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
30 lines
839 B
Text
30 lines
839 B
Text
---
|
|
title: lifespan
|
|
sidebarTitle: lifespan
|
|
---
|
|
|
|
# `fastmcp.server.mixins.lifespan`
|
|
|
|
|
|
Lifespan and Docket task infrastructure for FastMCP Server.
|
|
|
|
## Classes
|
|
|
|
### `LifespanMixin` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/mixins/lifespan.py#L25" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
|
|
Mixin providing lifespan and Docket task infrastructure for FastMCP.
|
|
|
|
|
|
**Methods:**
|
|
|
|
#### `docket` <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/server/mixins/lifespan.py#L29" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>
|
|
|
|
```python
|
|
docket(self: FastMCP) -> Docket | None
|
|
```
|
|
|
|
Get the Docket instance if Docket support is enabled.
|
|
|
|
Returns None if Docket is not enabled or server hasn't been started yet.
|
|
|