Closed caelansar closed 10 months ago
You have two options:
Connection
You have two options:
- Create an event loop and communicate with it via channels (send incoming streams out of the loop and request new streams by sending messages into it)
- Compose your application logic directly with a loop that continuously polls the
Connection
@thomaseizinger Thanks! I create a loop in new_client
method and send message in open_stream
via a channel to get a stream. Now it works as I expected
Hi! I recently tried to upgrade yamux to the latest version and I want to provide a method to create a stream from a connection in my project
In yamux 0.10.2, I can use
I can use
open_stream
to obtain a stream, but how can I do this in yamux 0.13.1 sinceControl
has been removed and we need callConnection::poll_next_inbound
repeatedly in order to make progressI found some examples in tests, it looks like:
but since the ownership of
client
has already been moved intotask::spawn
, how do I then obtain a stream from this connection afterward?