跳到主要内容

Channel

查看 Markdown

This page lists the Go SDK names for Channels. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Go SDK API reference.

API names​

TaskGo APIDex behavior
Define a ChannelDefineChannel, which returns a ChannelChannels
Define a ChannelMapDefineChannelMap, which returns a ChannelMapChannelMap
Declare it in the FlowChannels of PersistenceSchema, returned from GetPersistenceSchemaFlow definition
Publish a message from a Step or RPCPublishCommits
Wait for messagesForOne, ForN, AtLeast, AtMost, and AtLeastAtMostWait conditions
Read the messages a wait consumedGetConditionResultsChannel results
Load pending messages for a methodChannelMap.LoadMessages, with the load fields of StepOptions or RPCOptionsSelective state loading
Read loaded pending messagesPendingMessages and FindPendingMessagePending messages
Delete a pending messageDeletePending messages
Read the number of pending messagesSizeSelective state loading
Count ChannelMap instances and list their keysChannelMap.MapSize and ChannelMap.AllInstanceKeysChannelMap
Complete the Flow only when Channels are emptyForceCompleteIfChannelsEmptyForceCompleteIfChannelsEmpty

Example​

Example: examples/go/primitives/channel/workflow.go