|
C++ Actor Framework 0.19
|
Factory type for the with(...).accept(...).start(...) DSL.
More...
#include <server_factory.hpp>
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_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< disposable > | start (OnStart on_start) |
| Starts a server that makes HTTP requests without a fixed route available to an observer. | |
| expected< disposable > | start () |
| 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_base & | operator= (server_factory_base &&)=default |
| server_factory_base & | operator= (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_type & | config () |
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_ |
Factory type for the with(...).accept(...).start(...) DSL.
| server_factory & caf::net::http::server_factory::route | ( | std::string | path, |
| F | f | ||
| ) |
Adds a new route to the HTTP server.
| path | The path on this server for the new route. |
| f | The function object for handling requests on the new route. |
*this. | server_factory & caf::net::http::server_factory::route | ( | std::string | path, |
| http::method | method, | ||
| F | f | ||
| ) |
Adds a new route to the HTTP server.
| path | The path on this server for the new route. |
| method | The allowed HTTP method on the new route. |
| f | The function object for handling requests on the new route. |
*this.