MCPcopy Create free account
hub / github.com/bytecodealliance/wrpc / WithStreams

Method WithStreams

tests/go/async.go:18–23  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

16type AsyncHandler struct{}
17
18func (AsyncHandler) WithStreams(ctx context.Context) (io.ReadCloser, wrpc.Receiver[[][]string], error) {
19 slog.DebugContext(ctx, "handling `with-streams`")
20 buf := io.NopCloser(bytes.NewBuffer([]byte("test")))
21 str := wrpc.NewCompleteReceiver([][]string{{"foo"}, {"bar", "baz"}})
22 return buf, str, nil
23}
24
25func (AsyncHandler) WithFuture(ctx context.Context, x *async.Something, s io.ReadCloser) (wrpc.Receiver[io.ReadCloser], error) {
26 slog.DebugContext(ctx, "handling `with-future`", "x", x)

Callers 1

TestAsyncFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestAsyncFunction · 0.64