C++ Actor Framework 0.19
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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_config, server_factory >

Public Types

using super = dsl::server_factory_base< server_config, server_factory >
 
using config_type = typename super::config_type
 
- Public Types inherited from caf::net::dsl::server_factory_base< server_config, server_factory >
using config_type = server_config
 
using config_pointer = intrusive_ptr< config_type >
 

Public Member Functions

template<class ActorHandle >
server_factorymonitor (const ActorHandle &hdl)
 Monitors the actor handle hdl and stops the server if the monitored actor terminates.
 
template<class F >
server_factoryroute (std::string path, F f)
 Adds a new route to the HTTP server.
 
template<class F >
server_factoryroute (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_config, server_factory >
 server_factory_base (server_factory_base &&)=default
 
 server_factory_base (const server_factory_base &)=default
 
 server_factory_base (config_pointer cfg)
 
 server_factory_base (dsl::server_config_tag< T > token, Ts &&... xs)
 
server_factory_baseoperator= (server_factory_base &&)=default
 
server_factory_baseoperator= (const server_factory_base &)=default
 
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.
 
config_typeconfig ()
 

Additional Inherited Members

- Protected Member Functions inherited from caf::net::dsl::server_factory_base< server_config, server_factory >
server_factory & dref ()
 
- Protected Attributes inherited from caf::net::dsl::server_factory_base< server_config, server_factory >
config_pointer cfg_
 

Detailed Description

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

Member Function Documentation

◆ route() [1/2]

template<class F >
server_factory & caf::net::http::server_factory::route ( std::string  path,
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 
)

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 file: