OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
parsec/agent/client.hpp
Go to the documentation of this file.
1
// Copyright (c) 2021 MIT Digital Currency Initiative,
2
// Federal Reserve Bank of Boston
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#ifndef OPENCBDC_TX_SRC_PARSEC_AGENT_CLIENT_H_
7
#define OPENCBDC_TX_SRC_PARSEC_AGENT_CLIENT_H_
8
9
#include "
interface.hpp
"
10
#include "
messages.hpp
"
11
#include "
util/rpc/tcp_client.hpp
"
12
13
namespace
cbdc::parsec::agent::rpc
{
15
class
client
{
16
public
:
19
explicit
client
(std::vector<network::endpoint_t> endpoints);
20
21
client
() =
delete
;
22
~client
() =
default
;
23
client
(
const
client
&) =
delete
;
24
auto
operator=
(
const
client
&) ->
client
& =
delete
;
25
client
(
client
&&) =
delete
;
26
auto
operator=
(
client
&&) ->
client
& =
delete
;
27
30
auto
init
() -> bool;
31
39
auto
exec
(
runtime_locking_shard::key_type
function,
40
parameter_type
param,
41
bool
is_readonly_run,
42
const
interface::exec_callback_type
& result_callback)
43
-> bool;
44
45
private
:
46
std::unique_ptr<cbdc::rpc::tcp_client<request, response>> m_client;
47
};
48
}
49
50
#endif
cbdc::buffer
Buffer to store and retrieve byte data.
Definition
buffer.hpp:15
cbdc::parsec::agent::interface::exec_callback_type
std::function< void(exec_return_type)> exec_callback_type
Callback function type with function execution result.
Definition
parsec/agent/interface.hpp:52
cbdc::parsec::agent::rpc::client
RPC client for an agent.
Definition
parsec/agent/client.hpp:15
cbdc::parsec::agent::rpc::client::~client
~client()=default
cbdc::parsec::agent::rpc::client::operator=
auto operator=(const client &) -> client &=delete
cbdc::parsec::agent::rpc::client::client
client(const client &)=delete
cbdc::parsec::agent::rpc::client::client
client(client &&)=delete
cbdc::parsec::agent::rpc::client::exec
auto exec(runtime_locking_shard::key_type function, parameter_type param, bool is_readonly_run, const interface::exec_callback_type &result_callback) -> bool
Requests execution of the function at a key with the given parameters.
Definition
parsec/agent/client.cpp:20
cbdc::parsec::agent::rpc::client::client
client()=delete
cbdc::parsec::agent::rpc::client::init
auto init() -> bool
Intializes the underlying TCP client.
Definition
parsec/agent/client.cpp:16
cbdc::parsec::agent::rpc::client::operator=
auto operator=(client &&) -> client &=delete
cbdc::parsec::agent::rpc
Definition
parsec/agent/client.cpp:11
interface.hpp
messages.hpp
tcp_client.hpp
src
parsec
agent
client.hpp
Generated by
1.12.0