huijeong-kim / huijeong-kim.github.io

https://huijeong-kim.github.io
5 stars 0 forks source link

post/2022-08-27-tokio-mpsc/ #4

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Async Rust에서 mpsc queue 사용하기 – my-dev-note –

mpsc(multi produce single consumer) queue는 thread 간 message를 주고받는 channel로 많이 쓰입니다. std mpsc와 crossbeam channel가 많이 쓰이는 mpsc channel이고, async rust에서는 tokio mpsc를 사용할 수 있습니다.

http://huijeong-kim.github.io/2022/08/27/tokio-mpsc/

yyu-nim commented 2 years ago

누구나 빠질만한 함정이네요; async runtime 안에서 blocking 될 수 있는 코드를 넣을 때는 신중하게 라이브러리 써야 한다는 거군요; 예전에 짰던 코드들을 다시 살펴봐야 겠습니다 ㅎ 예제 공유해주셔서 감사합니다!