I have the following setup:
- A
reactor::Core
spun up in a separate thread. - A
Remote
handle to that detached Core. - A
Sink
to a single outgoing TCP connection.
(I got this byremote.spawn()
ing aTcpStream::connect()
, and using a oneshot channel to get the Sink part of the stream back. Technically, it's aSplitSink<Framed<TcpStream, BytesMut>>
)
I want to be able to send messages through this sink without waiting for the messages themselves to be physically sent. But I don't see a way to send data that doesn't consume my Sink and require me to set up a oneshot channel to get it back (because the Core is in a separate thread).
At the same time, it doesn't make sense for me that I need a message to be fully sent before I can get the Sink back to add more messages to it.
What I'm trying to have: a place to write bytes to (at any time), that abstracts sending those bytes in the background, so I don't have to wait for the network I/O.
Can someone point me in the right direction?
Thank you so much