CAF  0.17.3
Classes | Public Member Functions | Public Attributes | List of all members
caf::io::basp::message_queue Class Reference

Enforces strict order of message delivery, i.e., deliver messages in the same order as if they were deserialized by a single thread. More...

#include <message_queue.hpp>

Classes

struct  actor_msg
 Request for sending a message to an actor at a later time. More...
 

Public Member Functions

void push (execution_unit *ctx, uint64_t id, strong_actor_ptr receiver, mailbox_element_ptr content)
 Adds a new message to the queue or deliver it immediately if possible.
 
void drop (execution_unit *ctx, uint64_t id)
 Marks given ID as dropped, effectively skipping it without effect.
 
uint64_t new_id ()
 Returns the next ascending ID.
 

Public Attributes

std::mutex lock
 Protects all other properties.
 
uint64_t next_id
 The next available ascending ID. More...
 
uint64_t next_undelivered
 The next ID that we can ship.
 
std::vector< actor_msgpending
 Keeps messages in sorted order in case a message other than next_undelivered gets ready first.
 

Detailed Description

Enforces strict order of message delivery, i.e., deliver messages in the same order as if they were deserialized by a single thread.

Member Data Documentation

◆ next_id

uint64_t caf::io::basp::message_queue::next_id

The next available ascending ID.

The counter is large enough to overflow after roughly 600 years if we dispatch a message every microsecond.


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