Kagome
Polkadot Runtime Engine in C++17
kagome::metrics::Session Class Referenceabstract

session interface for OpenMetrics service More...

#include <session.hpp>

Inheritance diagram for kagome::metrics::Session:
Collaboration diagram for kagome::metrics::Session:

Classes

struct  Configuration
 

Public Types

using Body = boost::beast::http::string_body
 
using Request = boost::beast::http::request< Body >
 
using Response = boost::beast::http::response< Body >
 
using Context = boost::asio::io_context
 
using Socket = boost::asio::ip::tcp::socket
 
using ErrorCode = boost::system::error_code
 
using Streambuf = boost::asio::streambuf
 
using Duration = boost::asio::steady_timer::duration
 
using SessionId = uint64_t
 

Public Member Functions

virtual ~Session ()=default
 
virtual void start ()=0
 
virtual Socketsocket ()=0
 
virtual SessionId id () const =0
 
void connectOnRequest (std::function< OnRequestSignature > callback)
 connects on request callback More...
 
void processRequest (Request request, std::shared_ptr< Session > session)
 process request message More...
 
virtual void respond (Response message)=0
 send response message More...
 

Private Types

using OnRequestSignature = void(Request, std::shared_ptr< Session > session)
 

Private Attributes

std::function< OnRequestSignatureon_request_
 on request callback More...
 

Detailed Description

session interface for OpenMetrics service

Definition at line 19 of file session.hpp.

Member Typedef Documentation

using kagome::metrics::Session::Body = boost::beast::http::string_body

Definition at line 21 of file session.hpp.

using kagome::metrics::Session::Context = boost::asio::io_context

Definition at line 24 of file session.hpp.

using kagome::metrics::Session::Duration = boost::asio::steady_timer::duration

Definition at line 28 of file session.hpp.

using kagome::metrics::Session::ErrorCode = boost::system::error_code

Definition at line 26 of file session.hpp.

using kagome::metrics::Session::OnRequestSignature = void(Request, std::shared_ptr<Session> session)
private

Definition at line 32 of file session.hpp.

using kagome::metrics::Session::Request = boost::beast::http::request<Body>

Definition at line 22 of file session.hpp.

using kagome::metrics::Session::Response = boost::beast::http::response<Body>

Definition at line 23 of file session.hpp.

Definition at line 29 of file session.hpp.

using kagome::metrics::Session::Socket = boost::asio::ip::tcp::socket

Definition at line 25 of file session.hpp.

using kagome::metrics::Session::Streambuf = boost::asio::streambuf

Definition at line 27 of file session.hpp.

Constructor & Destructor Documentation

virtual kagome::metrics::Session::~Session ( )
virtualdefault

Member Function Documentation

void kagome::metrics::Session::connectOnRequest ( std::function< OnRequestSignature callback)
inline

connects on request callback

Definition at line 55 of file session.hpp.

virtual SessionId kagome::metrics::Session::id ( ) const
pure virtual
void kagome::metrics::Session::processRequest ( Request  request,
std::shared_ptr< Session session 
)
inline

process request message

Definition at line 62 of file session.hpp.

virtual void kagome::metrics::Session::respond ( Response  message)
pure virtual

send response message

Implemented in kagome::metrics::SessionImpl.

virtual Socket& kagome::metrics::Session::socket ( )
pure virtual
virtual void kagome::metrics::Session::start ( )
pure virtual

Member Data Documentation

std::function<OnRequestSignature> kagome::metrics::Session::on_request_
private

on request callback

Definition at line 33 of file session.hpp.


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