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

Factory type for the with(...).accept(...).start(...) DSL. More...

#include <server_factory.hpp>

Inheritance diagram for caf::net::http::server_factory:
caf::net::dsl::server_factory_base< server_factory >

Public Member Functions

template<class Token , class... Args>
 server_factory (Token token, const dsl::generic_config_value &from, Args &&... args)
 
 server_factory (server_factory &&other) noexcept
 
server_factoryoperator= (server_factory &&other) noexcept
 
server_factory && max_request_size (size_t value) &&
 Sets the maximum request size to value.
 
template<class ActorHandle >
server_factory && monitor (const ActorHandle &hdl) &&
 Monitors the actor handle hdl and stops the server if the monitored actor terminates.
 
template<class F >
server_factory && route (std::string path, F f) &&
 Adds a new route to the HTTP server.
 
template<class F >
server_factory && route (std::string path, http::method method, F f) &&
 Adds a new route to the HTTP server.
 
template<class OnStart >
expected< disposablestart (OnStart on_start) &&
 Starts a server that makes HTTP requests without a fixed route available to an observer.
 
expected< disposablestart () &&
 Starts a server that only serves the fixed routes.
 
- Public Member Functions inherited from caf::net::dsl::server_factory_base< server_factory >
server_factory && do_on_error (F callback) &&
 Sets the callback for errors.
 
server_factory && max_connections (size_t value) &&
 Configures how many concurrent connections the server accepts.
 
server_factory && reuse_address (bool value) &&
 Configures whether the server creates its socket with SO_REUSEADDR.
 

Protected Member Functions

dsl::server_config_value & base_config () override
 
- Protected Member Functions inherited from caf::net::dsl::server_factory_base< server_factory >
server_factory && dref ()
 
auto with_ssl_acceptor_or_socket (Fn &&fn)
 

Detailed Description

Factory type for the with(...).accept(...).start(...) DSL.

Member Function Documentation

◆ base_config()

dsl::server_config_value & caf::net::http::server_factory::base_config ( )
overrideprotectedvirtual

◆ route() [1/2]

template<class F >
server_factory && caf::net::http::server_factory::route ( std::string path,
F f ) &&

Adds a new route to the HTTP server.

Parameters
pathThe path on this server for the new route.
fThe function object for handling requests on the new route.
Returns
a reference to *this.

◆ route() [2/2]

template<class F >
server_factory && caf::net::http::server_factory::route ( std::string path,
http::method method,
F f ) &&

Adds a new route to the HTTP server.

Parameters
pathThe path on this server for the new route.
methodThe allowed HTTP method on the new route.
fThe function object for handling requests on the new route.
Returns
a reference to *this.

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