streamingFlow

fun streamingFlow(producer: suspend SendChannel<String>.() -> Unit): Flow<String>(source)

Helper that builds a context-safe Flow<String> suitable for InvocationResult.TextStream.

Use this when emitting items from a callback whose execution context differs from the Flow collector's context (typical for AWS SDK streaming callbacks). Internally a channelFlow is used so send calls cross coroutine contexts safely.