How add timestamp to rust stderr
I use tokio for async code and env_logger to stdout.So in stdout clear when the event took place: [2023-11-29T02:30:03Z INFO myapp] connected successBut in for panic in stderr only: Error: Io(Os {...
View ArticleIs tarpc hard limited to 64 RPCs per connection?
So I was playing around with the tarpc example library and wanted to see the limit of how many RPC calls the channel can support. I used this example from GitHub.I modified it slightly to print results...
View ArticleHow to avoid using a lock (Mutex) to read and send messages from a WebSocket...
I reimplement CRDTs algorithms to do tests, in particular the PN-Counter. To simulate multiple clients, I use a client/server architecture where the server forwards sent messages to all other clients....
View Articleare actors with Tokio the right approach for a data intensive application?
I'm working in a small rust crate whose purpose is to read data from server and write it to another, the data is received from a grpc endpoint and written to another grpc endpointthe server and clients...
View Articlesqlx unknown authentication plugin: auth_gssapi_client mariaDB
connecting to a mariaDB database using sqlxam passing a username and password to the connection string but the error reported is:Error: Protocol("unknown authentication plugin:...
View ArticleEquivalent of Condvar for tokio tasks
I'm using a framework that relies on the tokio runtime and I cannot use the current_thread variant of the runtime.I also use a foreign language interface, which gives me some restrictions regarding...
View ArticleHow do you get headers when using tokio-tungstenite?
I'm experimenting with the tokio-tungstenite crate to create chat rooms based on a URL. For example, I have a client connecting to ws://localhost:8080/abcd. My understanding is that I have to use the...
View ArticleLooping over a dataset asynchronously
I'm having Rust/tokio in mind while asking this question, but I think it's generic enough to apply to any mode of cooperative multitasking.One of the tasks my system needs to perform every second is to...
View ArticleHow can I serialize sequential access to a resource in a threaded server...
I'm writing a rust application that binds to a TCP/IP port and asynchronously spins up a stream handler for the connected sockets using tokio::spawn. I would like to handle multiple connections to the...
View ArticleRust & Tokio: How to gracefully shutdown a custom server running in a loop...
I'm building a Tokio server that provides multiple services such as http, gRPC, and more recently handles ZMQ messages. Graceful shutdown for http and gRPC is handled by a custom signal handler that...
View ArticleHow to share tokio::net::TcpStream act on it concurrently?
I have a requirement to send and receive normal data on the same TcpStream, while sending heartbeat data at regular intervals. In the current implementation, I used Arc<Mutex<TcpStream>>,...
View ArticleI have built a app using Tauri (Svelte + Rust). How to make async invoke...
The whole UI freezes when rust function is invoked that calls another async function.I created a tauri runtime in my main fn()Main function in main.rs :-fn main() { tauri::Builder::default()...
View ArticleIt is async but its execution is sequential
From tokio webpage:https://tokio.rs/tokio/tutorial/hello-tokioI appreciate that this is a tutorial and they have to start somewhere, but just to make sure I understand this code correctly...use...
View ArticleAsync recursive function for iterating over a B-Tree causes "Cannot resolve...
I'm trying to create a function that iterates over the elements of a B-Tree, in order. Accessing the children in my B-Tree is an async operation, so the function should return a AsyncStream. I'm using...
View ArticleHow to correctly poll after WouldBlock?
I am developing Rust Tokio library for ISO-TP. CAN protocol, which lets you send larger messages. The program is aimed towards linux only.For this, I am using Tokio structure AsyncFd. When the write is...
View ArticleStreaming a sequence of URL resources and concatenating to file
The scenario is as follows: a file is split into multiple parts and is available on a remote server, accessible over HTTPS. The purpose of this code is to stream all of the parts and reconstitute the...
View ArticleAsync web scraping in Rust
I am trying to perform asynchronous and parallel HTML scraping in Rust using tokio, reqwest and scraper crates. I have a loop that iterates through HTML elements and uses tokio::spawn to process each...
View ArticleHow to stop Telnet client from echoing
I'm using Rust w/ Tokio to build a simple TCP chat server. My code functions identically to their chat example here.However, when using the telnet client on my machine (MacOS 12.6.6) it always echoes...
View ArticleOther than calling `waker.wake()` how can I make sure the Future will be...
I'm looking into some more complex Rust projects and I noticed that a lot of them instead of using only async functions implement Future manually to get greater control of what happens.The problem is...
View ArticleRust OOP - Polymorphism limitation of a trait bound element of a vector of a...
I am working on a project where I would like to stream data from two data sources in separate threads but run into the following error:error[E0521]: borrowed data escapes outside of method -->...
View Article
More Pages to Explore .....