Module embassy_sync::channel

source ·
Expand description

A queue for sending values between asynchronous tasks.

It can be used concurrently by multiple producers (senders) and multiple consumers (receivers), i.e. it is an “MPMC channel”.

Receivers are competing for messages. So a message that is received by one receiver is not received by any other.

This queue takes a Mutex type so that various targets can be attained. For example, a ThreadModeMutex can be used for single-core Cortex-M targets where messages are only passed between tasks running in thread mode. Similarly, a CriticalSectionMutex can also be used for single-core targets where messages are to be passed from exception mode e.g. out of an interrupt handler.

This module provides a bounded channel that has a limit on the number of messages that it can store, and if this limit is reached, trying to send another message will result in an error being returned.

Structs§

Enums§