Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsocket channel request stream is moved into function #64

Open
Algorab opened this issue Jun 19, 2024 · 4 comments
Open

rsocket channel request stream is moved into function #64

Algorab opened this issue Jun 19, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Algorab
Copy link

Algorab commented Jun 19, 2024

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
Copy link
Member

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

@jjeffcaii jjeffcaii added the question Further information is requested label Jun 26, 2024
@Algorab
Copy link
Author

Algorab commented Jun 26, 2024

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

@Algorab
Copy link
Author

Algorab commented Jul 17, 2024

Have this now working, this show how to do it => https://docs.rs/tokio/latest/tokio/stream/index.html

@Algorab
Copy link
Author

Algorab commented Jul 17, 2024

An other question: What is the best suggestion for implementing a reconnect in a channel connection ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants