Channel
查看 MarkdownThis page lists the Rust SDK names for Channels. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Rust SDK API reference.
API names
| Task | Rust API | Dex behavior |
|---|---|---|
| Define a Channel | Channel | Channels |
| Define a ChannelMap | ChannelMap | ChannelMap |
| Declare it in the Flow | PersistenceSchema::channel and PersistenceSchema::channel_map, returned from Flow::persistence | Flow definition |
| Publish a message from a Step or RPC | publish | Commits |
| Wait for messages | for_one, for_n, at_least, at_most, and range | Wait conditions |
| Read the messages a wait consumed | condition_results | Channel results |
| Load pending messages for a method | ChannelMap::load_messages, with the load methods of StepOptions or Rpc | Selective state loading |
| Read loaded pending messages | pending_messages and find_pending_message | Pending messages |
| Delete a pending message | delete | Pending messages |
| Read the number of pending messages | size | Selective state loading |
| Count ChannelMap instances and list their keys | ChannelMap::map_size and ChannelMap::all_instance_keys | ChannelMap |
| Complete the Flow only when Channels are empty | StepDecision::force_complete_if_channels_empty, with when_empty | ForceCompleteIfChannelsEmpty |