OnStartWithStreamInputFn sets the callback invoked when a component receives streaming input. The handler receives a [*schema.StreamReader] that is a private copy; it MUST close the reader after consuming it to avoid goroutine and memory leaks.
( fn func(ctx context.Context, info *RunInfo, input *schema.StreamReader[CallbackInput]) context.Context)
| 139 | // private copy; it MUST close the reader after consuming it to avoid goroutine |
| 140 | // and memory leaks. |
| 141 | func (hb *HandlerBuilder) OnStartWithStreamInputFn( |
| 142 | fn func(ctx context.Context, info *RunInfo, input *schema.StreamReader[CallbackInput]) context.Context) *HandlerBuilder { |
| 143 | |
| 144 | hb.onStartWithStreamInputFn = fn |
| 145 | return hb |
| 146 | } |
| 147 | |
| 148 | // OnEndWithStreamOutputFn sets the callback invoked when a component produces |
| 149 | // streaming output. Like OnStartWithStreamInputFn, the handler receives a |
no outgoing calls