rsocket / rsocket-rust

RSocket Rust Implementation using Tokio
Apache License 2.0
199 stars 20 forks source link

rsocket channel request stream is moved into function #64

Open Algorab opened 2 weeks ago

Algorab commented 2 weeks ago

The function definition for channel is this fn request_channel(&self, reqs: Flux<Result<Payload>>) -> Flux<Result<Payload>> where flux is defined as Flux<T> = Pin<Box<dyn Send + Stream<Item = T>>>;

To request a channel it is required to put in a stream and get then a stream for receiving elements back.

When I want to send more elements after the first initial request to the rsocket server as far as I see this is not possible, due the variable is moved into the function and a clone is also not possible.

Expected have the possibility to add more elements to the request stream for a existing connection

jjeffcaii commented 1 week ago

You can use a channel, use the Rx as the reqs, and produce messages over Tx.

Algorab commented 1 week ago

Oh this is great. Did not see it. An example at the examples would be useful, if I not oversee it.