RESTinio
|
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 () |
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... | |
Coordinator for process of sending responses with respect to http pipeline technique and chunk transfer.
Definition at line 253 of file response_coordinator.hpp.
|
inline |
max_req_count | Maximum count of requests to keep track of. |
Definition at line 256 of file response_coordinator.hpp.
|
inline |
Add outgoing data for specified request.
req_id | Request id the responses parts are for. |
response_output_flags | Resp output flag. |
wg | The parts of response. |
Definition at line 289 of file response_coordinator.hpp.
|
inlinenoexcept |
Definition at line 266 of file response_coordinator.hpp.
|
inlinenoexcept |
Definition at line 267 of file response_coordinator.hpp.
|
inlinenoexcept |
Check if it is possible to accept more requests.
Definition at line 273 of file response_coordinator.hpp.
|
inlinenoexcept |
Definition at line 268 of file response_coordinator.hpp.
|
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 336 of file response_coordinator.hpp.
|
inline |
Create a new request and reserve context for its response.
Definition at line 280 of file response_coordinator.hpp.
|
inline |
Remove all contexts.
Invoke write groups after-write callbacks with error status.
Definition at line 378 of file response_coordinator.hpp.
|
private |
Indicate whether a response with connection close flag was emitted.
Definition at line 406 of file response_coordinator.hpp.
|
private |
A storage for resp-context items.
Definition at line 409 of file response_coordinator.hpp.
|
private |
Counter for asigining id to new requests.
Definition at line 403 of file response_coordinator.hpp.