Expand description
Computation of wRPC asynchronous subscription paths from Wasmtime component types.
When serving a component function over wRPC, the transport must be told which
nested positions of the parameters carry asynchronous values (streams and
futures) so it can subscribe to their data channels. wasi:io
input-stream/output-stream resources are bridged to wRPC stream<u8> by
this runtime, so they are treated as asynchronous here as well.
Note that at serve time the component has not been instantiated, so a
wasi:io stream parameter appears as the component’s own uninstantiated
resource type rather than the host [DynInputStream]/[DynOutputStream]
type. We therefore identify those resources by collecting the component’s
wasi:io/streams imports up front and comparing against them.
Functions§
- wasi_
io_ stream_ resources - Collect the (uninstantiated) resource types of the component’s imported
wasi:io/streamsinput-streamandoutput-stream, against which parameter resource types can be compared at serve time.