Iroha - A simple, decentralized ledger http://iroha.tech
ServerRunner Class Reference

#include "server_runner.hpp"

Collaboration diagram for ServerRunner:
Collaboration graph

Public Member Functions

 ServerRunner (const std::string &address, logger::LoggerPtr log, bool reuse=true)
ServerRunnerappend (std::shared_ptr< grpc::Service > service)
iroha::expected::Result< int, std::string > run ()
void waitForServersReady ()
void shutdown ()
void shutdown (const std::chrono::system_clock::time_point &deadline)

Detailed Description

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 Class runs Torii server for handling queries and commands.

Constructor & Destructor Documentation

ServerRunner::ServerRunner ( const std::string &  address,
logger::LoggerPtr  log,
bool  reuse = true 

Constructor. Initialize a new instance of ServerRunner class.

address- the address the server will be bind to in URI form
logto print progress to
reuse- allow multiple sockets to bind to the same port

Member Function Documentation

ServerRunner & ServerRunner::append ( std::shared_ptr< grpc::Service >  service)

Adds a new grpc service to be run.

service- service to append.
reference to this with service appended
iroha::expected::Result< int, std::string > ServerRunner::run ( )

Initialize the server and run main loop.

Result with used port number or error message
void ServerRunner::shutdown ( )

Ask grpc server to terminate.

void ServerRunner::shutdown ( const std::chrono::system_clock::time_point &  deadline)

Shutdown gRPC server with force on given deadline

void ServerRunner::waitForServersReady ( )

Wait until the server is up.

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