rsocket / rsocket-rust

RSocket Rust Implementation using Tokio
Apache License 2.0
209 stars 19 forks source link

question: request stream and channel for wasm-transport #12

Closed kuronyago closed 4 years ago

kuronyago commented 4 years ago

I want to implement the remaining methods for wasm transport, but I got stuck almost at the beginning

kuronyago commented 4 years ago

for example request stream

essentially I need to return the same Future, but with the Output = Stream type?

jjeffcaii commented 4 years ago

In current implementation, if you want to use RequestStream/RequestChannel, you had to use native rust code. (see here: https://github.com/jjeffcaii/rsocket-rust-wasm-example/blob/master/src/lib.rs) Well, it's not graceful and JsClient is not ready for stream. 😭 For RequestResponse, we can use Promise to wrap, but I don't known how to wrap stream payload(maybe use callback Fn). So you need to find best way to wrap stream before starting it. 😃

The community is open, welcome to join us! 😄