restinio::impl::response_coordinator_t Class Reference

Coordinator for process of sending responses with respect to http pipeline technique and chunk transfer. More...

`#include <response_coordinator.hpp>`

## Public Member Functions

| response_coordinator_t (std::size_t max_req_count)
bool | is_able_to_get_more_messages () const noexcept
| Check if it is possible to accept more requests. More...
request_id_t | register_new_request ()
| Create a new request and reserve context for its response. More...
void | append_response (request_id_t req_id, response_output_flags_t response_output_flags, write_group_t wg)
| Add outgoing data for specified request. More...
optional_t< std::pair< write_group_t, request_id_t > > | pop_ready_buffers ()
| Extract a portion of data available for write. More...
void | reset () noexcept
| Remove all contexts. More...
Response coordinator state.
Various state flags.
bool | closed () const noexcept
bool | empty () const noexcept
bool | is_full () const noexcept

## Private Attributes

request_id_t | m_request_id_counter { 0 }
| Counter for asigining id to new requests. More...
bool | m_connection_closed_response_occured { false }
| Indicate whether a response with connection close flag was emitted. More...
response_context_table_t | m_context_table
| A storage for resp-context items. More...

## Detailed Description

Coordinator for process of sending responses with respect to http pipeline technique and chunk transfer.

Definition at line 288 of file response_coordinator.hpp.

## Constructor & Destructor Documentation

## response_coordinator_t()

restinio::impl::response_coordinator_t::response_coordinator_t | ( | std::size_t | max_req_count | ) |

inline

Parameters

  max_req_count | Maximum count of requests to keep track of.

Definition at line 291 of file response_coordinator.hpp.

## Member Function Documentation

## append_response()

void restinio::impl::response_coordinator_t::append_response | ( | request_id_t | req_id,
|  | response_output_flags_t | response_output_flags,
|  | write_group_t | wg
| ) |  |

inline

Add outgoing data for specified request.

Parameters

  req_id | Request id the responses parts are for.
  response_output_flags | Resp output flag.
  wg | The parts of response.

Definition at line 324 of file response_coordinator.hpp.

## closed()

bool restinio::impl::response_coordinator_t::closed | ( |  | ) | const

inlinenoexcept

Definition at line 301 of file response_coordinator.hpp.

## empty()

bool restinio::impl::response_coordinator_t::empty | ( |  | ) | const

inlinenoexcept

Definition at line 302 of file response_coordinator.hpp.

## is_able_to_get_more_messages()

bool restinio::impl::response_coordinator_t::is_able_to_get_more_messages | ( |  | ) | const

inlinenoexcept

Check if it is possible to accept more requests.

Definition at line 308 of file response_coordinator.hpp.

## is_full()

bool restinio::impl::response_coordinator_t::is_full | ( |  | ) | const

inlinenoexcept

Definition at line 303 of file response_coordinator.hpp.

## pop_ready_buffers()

optional_t< std::pair< write_group_t, request_id_t > > restinio::impl::response_coordinator_t::pop_ready_buffers | ( |  | ) |

inline

Extract a portion of data available for write.

Data (if available) is wrapped in an instance of write_group_t. It can have a stats line mark (that is necessary for logging) and a notificator that must be invoked after the write operation of a given group completes.

Definition at line 371 of file response_coordinator.hpp.

## register_new_request()

request_id_t restinio::impl::response_coordinator_t::register_new_request | ( |  | ) |

inline

Create a new request and reserve context for its response.

Definition at line 315 of file response_coordinator.hpp.

## reset()

void restinio::impl::response_coordinator_t::reset | ( |  | ) |

inlinenoexcept

Remove all contexts.

Invoke write groups after-write callbacks with error status.

Note
  Since v.0.6.0 this method is noexcept

Definition at line 416 of file response_coordinator.hpp.

## Member Data Documentation

## m_connection_closed_response_occured

bool restinio::impl::response_coordinator_t::m_connection_closed_response_occured { false }

private

Indicate whether a response with connection close flag was emitted.

Definition at line 451 of file response_coordinator.hpp.

## m_context_table

response_context_table_t restinio::impl::response_coordinator_t::m_context_table

private

A storage for resp-context items.

Definition at line 454 of file response_coordinator.hpp.

## m_request_id_counter

request_id_t restinio::impl::response_coordinator_t::m_request_id_counter { 0 }

private

Counter for asigining id to new requests.

Definition at line 448 of file response_coordinator.hpp.

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

- restinio/impl/response_coordinator.hpp