Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Message Passing With Rust MPSC Channels - Rust Tutorial

Trevor Sullivan via YouTube

Overview

Explore message passing in Rust using MPSC (Multiple Producer, Single Consumer) channels in this 31-minute tutorial. Learn how to create channels, send data between threads, and work with sender and receiver handles. Discover the .send(), .recv(), and .recv_timeout() methods for managing message queues. Understand how Rust's generic channels allow for sending and receiving various data types. Dive into the std::sync::mpsc module, practice sending and receiving messages, and explore timeout functionality. Gain hands-on experience with closures and error handling in the context of channel communication. By the end of this tutorial, master the fundamentals of inter-thread communication in Rust using MPSC channels.

Syllabus

Introduction
Rust Documentation
Importing MPSC Module
Sending Messages
Sending Results
Receiving Messages
ReceiveTimeout
ReceiveResult
Closure
Print Line
Receive Message
Send Message
Testing
Outro

Taught by

Trevor Sullivan

Reviews

Start your review of Message Passing With Rust MPSC Channels - Rust Tutorial

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.