Inter-task communication.
Learn more: Channels
Classes | |
| class | pw::async2::ChannelHandle< T > |
Channel handle for a particular type T. More... | |
| class | pw::async2::MpmcChannelHandle< T > |
| A handle to a multi-producer, multi-consumer channel. More... | |
| class | pw::async2::MpscChannelHandle< T > |
| A handle to a multi-producer, single-consumer channel. More... | |
| class | pw::async2::SpmcChannelHandle< T > |
| A handle to a single-producer, multi-consumer channel. More... | |
| class | pw::async2::SpscChannelHandle< T > |
| A handle to a single-producer, single-consumer channel. More... | |
| class | pw::async2::MpChannelHandle< T > |
| class | pw::async2::McChannelHandle< T > |
| class | pw::async2::ChannelStorage< T, kCapacity > |
| class | pw::async2::ReceiveFuture< T > |
| class | pw::async2::Receiver< T > |
| A receiver which reads values from an asynchronous channel. More... | |
| class | pw::async2::SendFuture< T > |
| class | pw::async2::SendReservation< T > |
| class | pw::async2::ReserveSendFuture< T > |
| class | pw::async2::Sender< T > |
| A sender which writes values to an asynchronous channel. More... | |
Functions | |
| template<typename T > | |
| std::optional< MpmcChannelHandle< T > > | pw::async2::CreateMpmcChannel (Allocator &alloc, uint16_t capacity) |
| template<typename T , uint16_t kCapacity> | |
| MpmcChannelHandle< T > | pw::async2::CreateMpmcChannel (ChannelStorage< T, kCapacity > &storage) |
| template<typename T > | |
| std::optional< std::tuple< MpscChannelHandle< T >, Receiver< T > > > | pw::async2::CreateMpscChannel (Allocator &alloc, uint16_t capacity) |
| template<typename T , uint16_t kCapacity> | |
| std::tuple< MpscChannelHandle< T >, Receiver< T > > | pw::async2::CreateMpscChannel (ChannelStorage< T, kCapacity > &storage) |
| template<typename T > | |
| std::optional< std::tuple< SpmcChannelHandle< T >, Sender< T > > > | pw::async2::CreateSpmcChannel (Allocator &alloc, uint16_t capacity) |
| template<typename T , uint16_t kCapacity> | |
| std::tuple< SpmcChannelHandle< T >, Sender< T > > | pw::async2::CreateSpmcChannel (ChannelStorage< T, kCapacity > &storage) |
| template<typename T > | |
| std::optional< std::tuple< SpscChannelHandle< T >, Sender< T >, Receiver< T > > > | pw::async2::CreateSpscChannel (Allocator &alloc, uint16_t capacity) |
| template<typename T , uint16_t kCapacity> | |
| std::tuple< SpscChannelHandle< T >, Sender< T >, Receiver< T > > | pw::async2::CreateSpscChannel (ChannelStorage< T, kCapacity > &storage) |
| std::optional< MpmcChannelHandle< T > > pw::async2::CreateMpmcChannel | ( | Allocator & | alloc, |
| uint16_t | capacity | ||
| ) |
Creates a dynamically allocated multi-producer, multi-consumer channel with a fixed storage capacity.
Returns a handle to the channel which may be used to create senders and receivers. After all desired senders and receivers are created, the handle can be dropped without affecting the channel.
All allocation occurs during the creation of the channel. After this function returns, usage of the channel is guaranteed not to allocate. If allocation fails, returns std::nullopt.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
| MpmcChannelHandle< T > pw::async2::CreateMpmcChannel | ( | ChannelStorage< T, kCapacity > & | storage | ) |
Creates a multi-producer, multi-consumer channel with provided static storage.
Returns a handle to the channel which may be used to create senders and receivers. After all desired senders and receivers are created, the handle can be dropped without affecting the channel.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
The provided storage must outlive the channel.
| std::optional< std::tuple< MpscChannelHandle< T >, Receiver< T > > > pw::async2::CreateMpscChannel | ( | Allocator & | alloc, |
| uint16_t | capacity | ||
| ) |
Creates a dynamically allocated multi-producer, single-consumer channel with a fixed storage capacity.
Returns a handle to the channel which may be used to create senders. After all desired senders are created, the handle can be dropped without affecting the channel.
All allocation occurs during the creation of the channel. After this function returns, usage of the channel is guaranteed not to allocate. If allocation fails, returns std::nullopt.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
| std::tuple< MpscChannelHandle< T >, Receiver< T > > pw::async2::CreateMpscChannel | ( | ChannelStorage< T, kCapacity > & | storage | ) |
Creates a multi-producer, single-consumer channel with provided static storage.
Returns a handle to the channel which may be used to create senders. After all desired senders are created, the handle can be dropped without affecting the channel.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
The provided storage must outlive the channel.
| std::optional< std::tuple< SpmcChannelHandle< T >, Sender< T > > > pw::async2::CreateSpmcChannel | ( | Allocator & | alloc, |
| uint16_t | capacity | ||
| ) |
Creates a dynamically allocated single-producer, multi-consumer channel with a fixed storage capacity.
Returns a handle to the channel which may be used to create receivers. After all desired receivers are created, the handle can be dropped without affecting the channel.
All allocation occurs during the creation of the channel. After this function returns, usage of the channel is guaranteed not to allocate. If allocation fails, returns std::nullopt.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
| std::tuple< SpmcChannelHandle< T >, Sender< T > > pw::async2::CreateSpmcChannel | ( | ChannelStorage< T, kCapacity > & | storage | ) |
Creates a single-producer, multi-consumer channel with provided static storage.
Returns a handle to the channel which may be used to create receivers. After all desired receivers are created, the handle can be dropped without affecting the channel.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
The provided storage must outlive the channel.
| std::optional< std::tuple< SpscChannelHandle< T >, Sender< T >, Receiver< T > > > pw::async2::CreateSpscChannel | ( | Allocator & | alloc, |
| uint16_t | capacity | ||
| ) |
Creates a dynamically allocated single-producer, single-consumer channel with a fixed storage capacity.
Returns a handle to the channel alongside the sender and receiver. The handle can be used to forcefully close the channel. If that is not required, it can be dropped without affecting the channel.
All allocation occurs during the creation of the channel. After this function returns, usage of the channel is guaranteed not to allocate. If allocation fails, returns std::nullopt.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
| std::tuple< SpscChannelHandle< T >, Sender< T >, Receiver< T > > pw::async2::CreateSpscChannel | ( | ChannelStorage< T, kCapacity > & | storage | ) |
Creates a single-producer, single-consumer channel with provided static storage.
Returns a handle to the channel alongside the sender and receiver. The handle can be used to forcefully close the channel. If that is not required, it can be dropped without affecting the channel.
The channel remains open as long as at least either a handle, or at least one sender and one receiver exist.
The provided storage must outlive the channel.