The channel module

Concurrent activities often need to interact with each other. It's likely that you are already familiar with the mpsc module of the standard library, which uses blocking operations to send in channels, but this is not suitable for a sophisticated reactor that blocks completely if any operation blocks the working thread. Fortunately, however, there is the channel module in the futures crate which is capable of carrying out cross-task communication. The channel module contains two modules—mpsc and oneshot. Let's look at both.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.163.13