Why not design an mpmc?

I know std::sync::mpsc; is used to create a multi production and single consumption channel,In that case, why is there no design of more production and more consumption, or single production and more consumption, If there is a similar one, I think I don't need to use rabbitmq, kafaka pulsar and so on. I can use Rust to do MQ :slight_smile: lol~

use std::sync::mpsc;
use std::thread;

fn main(){
    let (tx, yx) = mpsc::channel()
    
    thread::spawn(move || {
      tx.send(String::from("rust :)")).unwrap();
    });
}

mpsc mpmc spmc

Crossbeam has an mpmc.

4 Likes

Take a look at the crossbeam_channel crate; it’s the de facto standard for more advanced channels than std provides.

3 Likes

Thanks. I'm watching it