Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::Channel< T > Class Template Reference

Represents a go-like channel, a multi-producer (Sender) multi-consumer (Receiver) thread-safe data pipe. More...

#include <Channel.hpp>

Static Public Member Functions

static std::pair< Sender, Receiver > create (auto &&context, std::size_t capacity)
 Factory function to create channel components.

Detailed Description

template<typename T>
class util::Channel< T >

Represents a go-like channel, a multi-producer (Sender) multi-consumer (Receiver) thread-safe data pipe.

Note
Use INSTANTIATE_CHANNEL_FOR_CLANG macro when using this class. See docs at the bottom of the file for more details.
Template Parameters
TThe type of data the channel transfers

Member Function Documentation

◆ create()

template<typename T>
std::pair< Sender, Receiver > util::Channel< T >::create ( auto && context,
std::size_t capacity )
inlinestatic

Factory function to create channel components.

Parameters
contextA supported context type (either io_context or thread_pool)
capacitySize of the internal buffer on the channel
Returns
A pair of Sender and Receiver

The documentation for this class was generated from the following file: