|
struct | mtcore::thread::BroadcastSubscription< T > |
| A subscription to a broadcaster. More...
|
|
struct | mtcore::thread::broadcaster< T > |
| A broadcaster is able to send messages to multiple channels, with each channel having its own lock Sending messages requires locking the entire broadcaster. More...
|
|
struct | mtcore::thread::Channel< T, Size > |
| Channel is a message-passing primitive between two threads A channel has blocking and non-blocking (or auto timed out for a size of 0) methods Timeout methods are also present A channel will have a buffer size for how many messages can be queued up If there is a buffer size of 0, then a reader and writer must both be accessing the channel simultaneously for messages to be transmitted. More...
|
|
struct | mtcore::thread::Future< T, E > |
| Represents a value that will be made available in the future Can wait on the value for when it is ready. More...
|
|
struct | mtcore::thread::FutureState< T, void > |
| Represents the state-setter part of a future. More...
|
|
struct | mtcore::thread::FutureState< T, E > |
| Represents the state-setter part of a future. More...
|
|
struct | mtcore::thread::Inbox< T > |
| Inter-thread communication primitive to send messages between threads Has a growable Queue. More...
|
|
struct | mtcore::thread::Subscription< T > |
| Represents a pub/sub subscription which can receive messages of type T Under the hood, each publisher maintains a message broker which stores all messages Subscribers will hold an Arc to the broker and will retrieve messages from the broker Due to the broker being shared, it does require more locks for both reads and writes This means it has a pretty low throughput when there is lots of contention The primary advantage is it has a much more convenient API for more non-blocking operations or timed blocks The reason this happens is that publishers are given greater insight into each subscription, and can better avoid partial writes. More...
|
|
struct | mtcore::thread::Publisher< T > |
| Represents a pub/sub publisher which can publish messages of type T Supports blocking and non-blocking publishing. More...
|
|
struct | mtcore::thread::Select< Options > |
| Underlying type for a select statement Use the "select" method directly for instantiation. More...
|
|
|
template<SelectOption... Options> |
Result< void, SelectErrors > | mtcore::thread::select (Options... opts) |
| Creates a "select statement" similar to Go's select statement, except this statement runs on thread-based primitives instead of coroutine-based primitives.
|
|
template<Sender S, typename Callback> |
SendOption< S, Callback > | mtcore::thread::send_to (S &to, typename S::Message msg, const Callback &callback) |
| Creates a select case which will try to send a message to a sender Option will call a callback on successful send.
|
|
template<Sender S> |
SendOptionNoCallback< S > | mtcore::thread::send_to (S &to, typename S::Message msg) |
| Creates a select case which will try to send a message to a sender.
|
|
template<typename Clock, typename Duration, typename Callback> |
BeforeOption< Clock, Duration, Callback > | mtcore::thread::before (const std::chrono::time_point< Clock, Duration > &tp, const Callback &callback) |
| The before option will timeout a select if an option is not hit before the target time point.
|
|
template<typename Clock, typename Duration> |
BeforeOptionNoCallback< Clock, Duration > | mtcore::thread::before (const std::chrono::time_point< Clock, Duration > &tp) |
| The before option will timeout a select if an option is not hit before the target time point.
|
|
template<typename Rep, typename Per, typename Callback> |
auto | mtcore::thread::timeout (const std::chrono::duration< Rep, Per > &tp, const Callback &callback) |
| Does a timeout relative to current time (e.g.
|
|
template<typename Rep, typename Per> |
auto | mtcore::thread::timeout (const std::chrono::duration< Rep, Per > &tp) |
| Does a timeout relative to current time (e.g.
|
|
template<Receiver R, typename Callback> |
ReceiveOption< R, Callback > | mtcore::thread::receive_from (R &from, const Callback &callback) |
| Creates a receive option for select which will execute when a message is ready.
|
|