Loading...
Searching...
No Matches
caf::stream_stage_driver< Input, DownstreamManager > Class Template Referenceabstract

Encapsulates user-provided functionality for generating a stream stage. More...

`#include <stream_stage_driver.hpp>`

Inheritance diagram for caf::stream_stage_driver< Input, DownstreamManager >:

## Public Types

using | input_type = Input
| Element type of the input stream.
using | downstream_manager_type = DownstreamManager
| Policy for distributing data to outbound paths.
using | output_type = typename downstream_manager_type::output_type
| Element type of the output stream.
using | stream_type = stream<output_type>
| Type of the output stream.
using | stage_type = stream_stage<input_type, DownstreamManager>
| Implemented stream_stage interface.
using | stage_ptr_type = intrusive_ptr<stage_type>
| Smart pointer to the interface type.

## Public Member Functions

| stream_stage_driver (DownstreamManager &out)
virtual void | process (downstream< output_type > &out, std::vector< input_type > &batch)=0
| Processes a single batch.
virtual void | finalize (const error &)
| Cleans up any state.
virtual bool | congested () const noexcept
| Can mark the stage as congested.
virtual int32_t | acquire_credit (inbound_path *path, int32_t desired)
| Acquires credit on an inbound path.

## Protected Attributes

DownstreamManager & | out_

## Detailed Description

template<class Input, class DownstreamManager>
class caf::stream_stage_driver< Input, DownstreamManager >

Encapsulates user-provided functionality for generating a stream stage.

## Member Function Documentation

## acquire_credit()

template<class Input, class DownstreamManager>

virtual int32_t caf::stream_stage_driver< Input, DownstreamManager >::acquire_credit | ( | inbound_path * | path,
|  | int32_t | desired )

virtual

Acquires credit on an inbound path.

The calculated credit to fill our queue fro two cycles is desired, but the driver is allowed to return any non-negative value.

## congested()

template<class Input, class DownstreamManager>

virtual bool caf::stream_stage_driver< Input, DownstreamManager >::congested | ( |  | ) | const

virtual noexcept

Can mark the stage as congested.

The default implementation signals a congestion if the downstream manager has no capacity left in its buffer.

## finalize()

template<class Input, class DownstreamManager>

virtual void caf::stream_stage_driver< Input, DownstreamManager >::finalize | ( | const error & |  | ) |

virtual

Cleans up any state.

Reimplemented in caf::detail::stream_stage_driver_impl< Input, DownstreamManager, Process, Finalize >.

## process()

template<class Input, class DownstreamManager>

virtual void caf::stream_stage_driver< Input, DownstreamManager >::process | ( | downstream< output_type > & | out,
|  | std::vector< input_type > & | batch )

pure virtual

Processes a single batch.

Implemented in caf::detail::stream_stage_driver_impl< Input, DownstreamManager, Process, Finalize >.

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

- /build/actor-framework-Z9pIPl/actor-framework-0.17.6/libcaf_core/caf/stream_stage_driver.hpp