Skip to main content

Stream

View as Markdown

This page lists the Go SDK names for Streams. 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 Stream and its byte capacityDefineStream, with its streamCapacityBytes argumentCapacity and trimming
Declare it in the FlowStreams of PersistenceSchema, returned from GetPersistenceSchemaFlow definition
Write a message from a StepStream.WriteWrite semantics
Write text chunks in batches from a StepNewBufferedTextStream, which returns a BufferedTextStreamBuffer text chunks
Write a message from a ClientClient.WriteStreamWrite semantics
Read the next messageClient.ReadStream, with the ResumeToken of the last StreamMessageResumable reads
List retained messages, newest firstClient.ListStreamMessages, into a StreamMessagesPageList messages

Stream.Write works in WaitFor, Execute, and the Flow timeout handler. An RPC handler cannot write a Stream. Stream.Write sends the message right away. Its error covers only local validation, encoding, and transport.

Example​

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