SObjectizer-5 Extra
Loading...
Searching...
No Matches
so_5::extra::mboxes::inflight_limit Namespace Reference

Namespaces

namespace  errors
 
namespace  impl
 

Typedefs

using underlying_counter_t = unsigned int
 Type to be used for limit and counter of inflight messages.
 

Functions

template<typename Msg_Type >
mbox_t make_mbox (mbox_t dest_mbox, underlying_counter_t inflight_limit)
 Create an instance of inflight_limit_mbox.
 

Typedef Documentation

◆ underlying_counter_t

Type to be used for limit and counter of inflight messages.

Since
v.1.5.2

Definition at line 31 of file inflight_limit.hpp.

Function Documentation

◆ make_mbox()

template<typename Msg_Type >
mbox_t so_5::extra::mboxes::inflight_limit::make_mbox ( mbox_t dest_mbox,
underlying_counter_t inflight_limit )
nodiscard

Create an instance of inflight_limit_mbox.

Usage example:

so_5::environment_t & env = ...;
// Create an inflight_limit_mbox with underlying MPMC mbox for immutable message.
auto my_mbox = mbox_ns::make_mbox<my_msg>(env.create_mbox(), 15u);
// Create an inflight_limit_mbox with underlying MPSC mbox for mutable message.
class demo_agent : public so_5::agent_t
{
const so_5::mbox_t my_mbox_;
public:
demo_agent(context_t ctx)
: so_5::agent_t{std::move(ctx)}
, my_mbox{ mbox_ns::make_mbox< so_5::mutable_msg<my_msg> >(so_direct_mbox(), 4u) }
{...}
...
};
Ranges for error codes of each submodules.
Definition details.hpp:13
Template Parameters
Msg_Typetype of message to be used with a new mbox.
Since
v.1.5.2
Parameters
dest_mboxActual destination mbox.
inflight_limitThe limit of inflight messages.

Definition at line 524 of file inflight_limit.hpp.