> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# worker_channel_cleanup

# `prefect.server.utilities.worker_channel_cleanup`

## Classes

### `WorkerCleanupInFlight` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L29](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L29)</sup>

### `WorkerCleanupConnectionRegistry` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L35](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L35)</sup>

**Methods:**

#### `dispatch_available` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L173](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L173)</sup>

```python theme={null}
dispatch_available(self) -> None
```

#### `forget_cleanup_reservation` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L151](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L151)</sup>

```python theme={null}
forget_cleanup_reservation(self, connection: WorkerChannelConnection) -> bool
```

#### `has_cleanup_capacity` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L101](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L101)</sup>

```python theme={null}
has_cleanup_capacity(self, connection: WorkerChannelConnection, max_cleanup_concurrency: int) -> bool
```

#### `register` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L56](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L56)</sup>

```python theme={null}
register(self, connection: WorkerChannelConnection) -> AsyncIterator[None]
```

#### `track_cleanup_reservation` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L110](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L110)</sup>

```python theme={null}
track_cleanup_reservation(self, connection: WorkerChannelConnection, in_flight: WorkerCleanupInFlight, max_cleanup_concurrency: int) -> bool
```

#### `update_cleanup_lease` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L128](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L128)</sup>

```python theme={null}
update_cleanup_lease(self, connection: WorkerChannelConnection) -> bool
```

#### `wake_dispatcher` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker\_channel\_cleanup.py#L211](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/worker_channel_cleanup.py#L211)</sup>

```python theme={null}
wake_dispatcher(self, work_pool_id: UUID) -> None
```
