C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
caf::detail::token_based_credit_controller Class Reference

A credit controller that estimates the bytes required to store incoming batches and constrains credit based on upper bounds for memory usage. More...

#include <token_based_credit_controller.hpp>

Inheritance diagram for caf::detail::token_based_credit_controller:
caf::credit_controller

Public Member Functions

 token_based_credit_controller (local_actor *self)
 
void before_processing (downstream_msg::batch &batch) override
 Called before processing the batch x in order to allow the controller to keep statistics on incoming batches.
 
calibration init () override
 Returns an initial calibration for the path.
 
calibration calibrate () override
 Computes a credit assignment to the source after crossing the low-threshold.
 
virtual void before_processing (downstream_msg::batch &batch)=0
 Called before processing the batch x in order to allow the controller to keep statistics on incoming batches.
 
virtual calibration init ()=0
 Returns an initial calibration for the path.
 
virtual calibration calibrate ()=0
 Computes a credit assignment to the source after crossing the low-threshold.
 

Static Public Member Functions

template<class T >
static auto make (local_actor *self, stream< T >)
 

Public Attributes

int32_t initial_buffer_size = 10
 Stores how many elements we buffer at most after the handshake.
 
int32_t initial_batch_size = 2
 Stores how many elements we allow per batch after the handshake.
 

Static Public Attributes

static constexpr int32_t min_samples = 50
 Configures how many samples we require for recalculating buffer sizes.
 

Detailed Description

A credit controller that estimates the bytes required to store incoming batches and constrains credit based on upper bounds for memory usage.

Member Function Documentation

◆ before_processing()

void caf::detail::token_based_credit_controller::before_processing ( downstream_msg::batch batch)
overridevirtual

Called before processing the batch x in order to allow the controller to keep statistics on incoming batches.

Implements caf::credit_controller.

◆ calibrate()

calibration caf::detail::token_based_credit_controller::calibrate ( )
overridevirtual

Computes a credit assignment to the source after crossing the low-threshold.

May assign zero credit.

Implements caf::credit_controller.

◆ init()

calibration caf::detail::token_based_credit_controller::init ( )
overridevirtual

Returns an initial calibration for the path.

Implements caf::credit_controller.


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