Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::ng Namespace Reference

The next generation web server implementation. More...

Classes

class  Connection
 A class representing a connection to a client. More...
 An interface for a connection metadata class. More...
class  Request
 Represents an HTTP or WebSocket request. More...
class  Response
 Represents an HTTP or Websocket response. More...
class  RPCServerHandler
 The server handler for RPC requests called by web server. More...
class  Server
 Web server class. More...
class  SubscriptionContext
 Implementation of SubscriptionContextInterface. More...

Typedefs

using ConnectionPtr = std::unique_ptr<Connection>
 A pointer to a connection.
using Error = boost::system::error_code
 Error of any async operation.
using MessageHandler
 Handler for messages.

Enumerations

enum class  ProcessingPolicy { Sequential , Parallel }
 Requests processing policy. More...

Functions

std::expected< Server, std::string > makeServer (util::config::ClioConfigDefinition const &config, Server::OnConnectCheck onConnectCheck, Server::OnIpChangeHook onIpChangeHook, Server::OnDisconnectHook onDisconnectHook, boost::asio::io_context &context)
 Create a new Server.

Detailed Description

The next generation web server implementation.

Typedef Documentation

◆ MessageHandler

Initial value:
std::function<Response(
Request const&,
boost::asio::yield_context
)>
An interface for a connection metadata class.
Definition Connection.hpp:28
Represents an HTTP or WebSocket request.
Definition Request.hpp:18
Represents an HTTP or Websocket response.
Definition Response.hpp:21
std::shared_ptr< SubscriptionContextInterface > SubscriptionContextPtr
An alias for shared pointer to a SubscriptionContextInterface.
Definition SubscriptionContextInterface.hpp:64

Handler for messages.

Enumeration Type Documentation

◆ ProcessingPolicy

enum class web::ng::ProcessingPolicy
strong

Requests processing policy.

Enumerator
Sequential 

Requests from a connection are processed one at a time, in order.

Parallel 

Requests from a connection may be processed concurrently.

Function Documentation

◆ makeServer()

std::expected< Server, std::string > web::ng::makeServer ( util::config::ClioConfigDefinition const & config,
Server::OnConnectCheck onConnectCheck,
Server::OnIpChangeHook onIpChangeHook,
Server::OnDisconnectHook onDisconnectHook,
boost::asio::io_context & context )

Create a new Server.

Parameters
configThe configuration.
onConnectCheckThe check to perform on each client connection.
onIpChangeHookThe hook to call when a client's IP changes.
onDisconnectHookThe hook to call when client disconnects.
contextThe boost::asio::io_context to use.
Returns
The Server or an error message.