Buffered reader line iterator hangs with no errors
I have a TCP server that tries to replicate a Redis client, which responds to
What are the differences between tokio_util::StreamExt and futures::StreamExt?
While developing my web application, I utilized the tokio_util::StreamExt::then method to manage the request stream. Surprisingly, I observed that replacing tokio_util::StreamExt with futures::StreamExt ,my code still worked. I’m curious about the underlying reason for this occurrence.
To gain further insight, I attempted to consult the documentation at docs.rs/tokio_util; however, I found it to be quite challenging to comprehend. Could someone lend me a hand in understanding this matter?
Migrating process to tokio
I’ve got a process that analyzes data as it comes into a network connection. These frames are about 128 bytes, and the processing takes about 1.8us. While that might seem plenty fast, the sheer number of frames to be evaluated is enough to evaluate how to multi-thread the work.
Rust – Using instance of struct in two async tasks
Im trying to have a simple Struct in Rust to understand how to implement a Server that listening for clients, and have a method for sending data.
Using a generic function with one generic and one concrete type
Trying to get a better grasp of traits and generics, so building a simple tcp server master-slave like library, currently I have this layout
How to access request component using Poem
I’m trying to access the headers, url path, query parameters and other http information associated with a request received by my poem server. The server uses poem-openapi and tokio to receive and process requests. Here’s the driving code from main.rs:
How to map an async channel of bytes array to a deserialized concrete type async channel?
I’m trying to implement a function to map a Receiver<Vec<u8>>
to Receiver<T>
, where Receiver
is short for tokio::sync::mpsc::Receiver
. And T
is deserialized from Vec<u8>
, I’m using the bincode
crate to do that. Here’s my implementation:
Rust project is suddenly failing on Windows – slice::from_raw_parts requires the pointer to be aligned and non-null
I think it’s something with the SDK because it’s the same code that used to run fine. It still runs fine on Linux.
Is AsyncReadExt::read cancel safe?
I am wondering if Tokio’s AsyncReadExt::read
method is cancel safe.
More specifically, say I invoke, e.g., socket.read(&mut my_buf)
from within a tokio::select
, but my invocation gets cancelled before returning. Can I trust that no bytes were read from socket
, i.e., that socket
is in the same state as before I called socket.read
?
Sharing reqwest::Client between tokio tasks
I am trying to spawn several tokio tasks that are supposed to be querying various web APIs. My plan was to use reqwest::Client
for that.