|
C++ Actor Framework 0.18
|
State for a path to an upstream actor (source). More...
#include <inbound_path.hpp>
Classes | |
| struct | metrics_t |
| Wraps optional actor metrics collected by this path. More... | |
Public Types | |
| using | regular_shutdown = upstream_msg::drop |
| Message type for propagating graceful shutdowns. | |
| using | irregular_shutdown = upstream_msg::forced_drop |
| Message type for propagating errors. | |
| using | time_point = typename actor_clock::time_point |
| Discrete point in time, as reported by the actor clock. | |
| using | duration_type = typename actor_clock::duration_type |
| Time interval, as reported by the actor clock. | |
Public Member Functions | |
| template<class T > | |
| inbound_path (stream_manager *mgr, stream< T > in) | |
| void | init (strong_actor_ptr source_hdl, stream_slots id) |
| bool | up_to_date () const noexcept |
Returns whether the path received no input since last emitting ack_batch, i.e., last_acked_batch_id == last_batch_id. | |
| scheduled_actor * | self () const noexcept |
| Returns a pointer to the parent actor. | |
| int32_t | available_credit () const noexcept |
| Returns currently unassigned credit that we could assign to the source. | |
| const settings & | config () const noexcept |
| Returns the system-wide configuration. | |
| void | handle (downstream_msg::batch &x) |
Updates last_batch_id and assigned_credit before dispatching to the manager. | |
| void | handle (downstream_msg::close &x) |
Forward the close message to the manager. | |
| void | handle (downstream_msg::forced_close &x) |
Forward the forced_close message to the manager. | |
| void | tick (time_point now, duration_type max_batch_delay) |
| Forces an ACK message after receiving no input for a considerable amount of time. | |
| void | emit_ack_open (local_actor *self, actor_addr rebind_from) |
Emits an upstream_msg::ack_batch. | |
| void | emit_ack_batch (local_actor *self, int32_t new_credit) |
Sends an upstream_msg::ack_batch for granting new credit. | |
| void | emit_regular_shutdown (local_actor *self) |
Sends an upstream_msg::drop on this path. | |
| void | emit_irregular_shutdown (local_actor *self, error reason) |
Sends an upstream_msg::forced_drop on this path. | |
Static Public Member Functions | |
| static void | emit_irregular_shutdown (local_actor *self, stream_slots slots, const strong_actor_ptr &hdl, error reason) |
Sends an upstream_msg::forced_drop. | |
Public Attributes | |
| stream_manager * | mgr |
| Points to the manager responsible for incoming traffic. | |
| strong_actor_ptr | hdl |
| Handle to the source. | |
| stream_slots | slots |
| Stores slot IDs for sender (hdl) and receiver (self). | |
| metrics_t | metrics |
| Stores pointers to optional telemetry objects. | |
| int32_t | desired_batch_size = 0 |
| Stores the last computed desired batch size. | |
| int32_t | assigned_credit = 0 |
| Amount of credit we have signaled upstream. | |
| int32_t | max_credit = 0 |
| Maximum amount of credit that the path may signal upstream. | |
| int32_t | calibration_countdown = 10 |
| Decremented whenever receiving a batch. | |
| stream_priority | prio = stream_priority::normal |
| Priority of incoming batches from this source. | |
| int64_t | last_acked_batch_id = 0 |
| ID of the last acknowledged batch ID. | |
| int64_t | last_batch_id = 0 |
| ID of the last received batch. | |
| std::unique_ptr< credit_controller > | controller_ |
| Controller for assigning credit to the source. | |
| time_point | last_ack_time |
| Stores when the last ACK was emitted. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<class Inspector > | |
| bool | inspect (Inspector &f, inbound_path &x) |
State for a path to an upstream actor (source).
| void caf::inbound_path::emit_ack_batch | ( | local_actor * | self, |
| int32_t | new_credit | ||
| ) |
Sends an upstream_msg::ack_batch for granting new credit.
| self | Points to the parent actor, i.e., sender of the message. |
| new_credit | Amount of new credit to assign to the source. |
| int32_t caf::inbound_path::calibration_countdown = 10 |
Decremented whenever receiving a batch.
Triggers a re-calibration by the controller when reaching zero.
| int32_t caf::inbound_path::desired_batch_size = 0 |
Stores the last computed desired batch size.
Adjusted at run-time by the controller.
| int32_t caf::inbound_path::max_credit = 0 |
Maximum amount of credit that the path may signal upstream.
Adjusted at run-time by the controller.