Sync job queue with async feed

Hello everyone,
I am fairly new to rustlang, but it is offering some interesting concepts.
The plan is it to feed data into a queue, which is processed sync. I receive the data with async TCP server via Tokio-Core and -IO. I want to know which concept is the best to "enqueue" my queue sync in Rust and process the data successively. The fed data are parameters for a "method" running on core too.

I would love to see some help here. In fact, this whole Rust and Future thing is completly new to me. I try to understand it by doing.
Oh, if there a information missing, please write it. I will pass it then.
Best regards
Christopher

1 Like

Well, I don't know if I got you right, but I would do it as follows:

Create a channel and pass the RX to the queue (running in a separate thread). The Tokio receiver will get the TX and send everything through the channel to your "working queue".

See std::sync::mpsc - Rust

2 Likes

Yes, this was exactly I was looking for. Thank you very much. The next time I will use google better than I did.

1 Like