---
title: "Channel"
description: "This page lists the Python SDK names for Channels."
canonical_url: "https://docs.superdurable.io/reference/python/channel/"
source: "docs/reference/python/channel.mdx"
locale: "en"
---

# Channel

This page lists the Python SDK names for [Channels](https://docs.superdurable.io/concepts/primitives/channel.md).
The doc comment of each API gives its parameters, defaults, and errors. Read
them in the [Python SDK API reference](https://docs.superdurable.io/reference/python.md#api-reference).

<a id="api-names"></a>

## API names

| Task                                           | Python API                                                                        | Dex behavior                                                                                                                 |
| ---------------------------------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Define a Channel                               | **Channel**                                                                       | [Channels](https://docs.superdurable.io/reference/server/runtime-data.md#channels)                                           |
| Define a ChannelMap                            | **ChannelMap**                                                                    | [ChannelMap](https://docs.superdurable.io/reference/server/runtime-data.md#channelmap)                                       |
| Declare it in the Flow                         | **PersistenceSchema.of**, returned from **get_persistence_schema**                | [Flow definition](https://docs.superdurable.io/reference/python/flow.md#flow-definition)                                     |
| Publish a message from a Step or RPC           | **publish**                                                                       | [Commits](https://docs.superdurable.io/reference/python/step.md#commit-boundary)                                             |
| Wait for messages                              | **for_one**, **for_n**, **at_least**, **at_most**, and **for_range**              | [Wait conditions](https://docs.superdurable.io/reference/server/runtime-data.md#channel-conditions)                          |
| Read the messages a wait consumed              | **results**                                                                       | [Channel results](https://docs.superdurable.io/reference/python/waits.md#channel-results)                                    |
| Load pending messages for a method             | **ChannelMap.load_messages**, with the load fields of **StepOptions** or **@rpc** | [Selective state loading](https://docs.superdurable.io/reference/python/step-options.md#selective-state-loading)             |
| Read loaded pending messages                   | **pending_messages** and **find_pending_message**                                 | [Pending messages](https://docs.superdurable.io/reference/server/runtime-data.md#manage-pending-messages)                    |
| Delete a pending message                       | **delete**                                                                        | [Pending messages](https://docs.superdurable.io/reference/server/runtime-data.md#manage-pending-messages)                    |
| Read the number of pending messages            | **size**                                                                          | [Selective state loading](https://docs.superdurable.io/reference/python/step-options.md#selective-state-loading)             |
| Count ChannelMap instances and list their keys | **ChannelMap.get_map_size** and **ChannelMap.get_all_instance_keys**              | [ChannelMap](https://docs.superdurable.io/reference/server/runtime-data.md#channelmap)                                       |
| Complete the Flow only when Channels are empty | **force_complete_if_channels_empty**                                              | [ForceCompleteIfChannelsEmpty](https://docs.superdurable.io/reference/python/step-decisions.md#forcecompleteifchannelsempty) |

<a id="example"></a>

## Example

Example: [examples/python/dex_examples/primitives/channel/channel_flow.py](https://github.com/superdurable/dex/tree/main/examples/python/dex_examples/primitives/channel/channel_flow.py)
