#JS <=> Rust worker streaming

2 messages · Page 1 of 1 (latest)

outer stone
#

Hi I'm trying to calling from JS service to Rust service using RPC.
the RPC output (and input) is limited in 1MB to I have to use stream to bypass the limit

I tried with

    let stream1 = str_to_readable_stream(String::from_utf8(out).unwrap().as_str());
    let stream = wasm_streams::ReadableStream::from_raw(stream1);
    Ok(ByteStream { inner: stream })

However I always getting "The destination execution context for this RPC was canceled while the call was still running.". Has anyone experienced this?

#

also tried Ok(str_to_readable_stream(String::from_utf8(out).unwrap().as_str())) or Ok(wasm_streams::ReadableStream::from_raw(stream1)) but doesn't work either