Skip to main content

Channel

View as Markdown

This 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​

TaskRust APIDex behavior
Define a ChannelChannelChannels
Define a ChannelMapChannelMapChannelMap
Declare it in the FlowPersistenceSchema::channel and PersistenceSchema::channel_map, returned from Flow::persistenceFlow definition
Publish a message from a Step or RPCpublishCommits
Wait for messagesfor_one, for_n, at_least, at_most, and rangeWait conditions
Read the messages a wait consumedcondition_resultsChannel results
Load pending messages for a methodChannelMap::load_messages, with the load methods of StepOptions or RpcSelective state loading
Read loaded pending messagespending_messages and find_pending_messagePending messages
Delete a pending messagedeletePending messages
Read the number of pending messagessizeSelective state loading
Count ChannelMap instances and list their keysChannelMap::map_size and ChannelMap::all_instance_keysChannelMap
Complete the Flow only when Channels are emptyStepDecision::force_complete_if_channels_empty, with when_emptyForceCompleteIfChannelsEmpty

Example​

Example: examples/rust/src/primitives/channel/flow.rs