C++ Actor Framework 1.0.0
|
Sits on top of a server and dispatches incoming requests to user-defined handlers. More...
#include <router.hpp>
Inherits caf::net::http::upper_layer::server.
Public Member Functions | |
router (std::vector< route_ptr > routes) | |
lower_layer::server * | down () |
Returns a pointer to the underlying HTTP layer. | |
actor_shell * | self () |
Returns an actor_shell for this router that enables routes to interact with actors. | |
request | lift (responder &&res) |
Lifts a responder to an request object that allows asynchronous processing of the HTTP request. | |
void | shutdown (const error &err) |
error | start (lower_layer::server *down) override |
ptrdiff_t | consume (const request_header &hdr, const_byte_span payload) override |
void | prepare_send () override |
Gives the upper layer an opportunity to add additional data to the output buffer. | |
bool | done_sending () override |
Queries whether all pending data has been sent. | |
void | abort (const error &reason) override |
Called by the lower layer for cleaning up any state in case of an error or when disposed. | |
Static Public Member Functions | |
static std::unique_ptr< router > | make (std::vector< route_ptr > routes) |
Sits on top of a server and dispatches incoming requests to user-defined handlers.
|
overridevirtual |
Called by the lower layer for cleaning up any state in case of an error or when disposed.
Implements caf::net::generic_upper_layer.
|
overridevirtual |
Queries whether all pending data has been sent.
The lower calls this function to decide whether it has to wait for write events on the socket.
Implements caf::net::generic_upper_layer.
|
overridevirtual |
Gives the upper layer an opportunity to add additional data to the output buffer.
Implements caf::net::generic_upper_layer.