C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::net::http::router Class Reference

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_shellself ()
 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< routermake (std::vector< route_ptr > routes)
 

Detailed Description

Sits on top of a server and dispatches incoming requests to user-defined handlers.

Member Function Documentation

◆ abort()

void caf::net::http::router::abort ( const error & reason)
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.

◆ done_sending()

bool caf::net::http::router::done_sending ( )
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.

◆ prepare_send()

void caf::net::http::router::prepare_send ( )
overridevirtual

Gives the upper layer an opportunity to add additional data to the output buffer.

Implements caf::net::generic_upper_layer.


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