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"
12
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
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
Buffer to store and retrieve byte data.
Definition buffer.hpp:15
std::function< void(exec_return_type)> exec_callback_type
Callback function type with function execution result.
auto operator=(const client &) -> client &=delete
client(const client &)=delete
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.
auto init() -> bool
Intializes the underlying TCP client.
auto operator=(client &&) -> client &=delete