hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
status_bus_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef TORII_STATUS_BUS_IMPL
7 #define TORII_STATUS_BUS_IMPL
8 
9 #include "torii/status_bus.hpp"
10 
11 namespace iroha {
12  namespace torii {
16  class StatusBusImpl : public StatusBus {
17  public:
19  rxcpp::observe_on_one_worker worker = rxcpp::observe_on_new_thread());
20 
21  ~StatusBusImpl() override;
22 
23  void publish(StatusBus::Objects) override;
25  rxcpp::observable<StatusBus::Objects> statuses() override;
26 
27  // Need to create once, otherwise will create thread for each subscriber
28  rxcpp::observe_on_one_worker worker_;
29  rxcpp::composite_subscription cs_;
30  rxcpp::subjects::synchronize<StatusBus::Objects, decltype(worker_)>
32  };
33  } // namespace torii
34 } // namespace iroha
35 
36 #endif // TORII_STATUS_BUS_IMPL
Definition: command_client.hpp:16
rxcpp::subjects::synchronize< StatusBus::Objects, decltype(worker_)> subject_
Definition: status_bus_impl.hpp:31
std::shared_ptr< shared_model::interface::TransactionResponse > Objects
Objects that represent status to operate with.
Definition: status_bus.hpp:23
void publish(StatusBus::Objects) override
Definition: status_bus_impl.cpp:17
rxcpp::observable< StatusBus::Objects > statuses() override
Subscribers will be invoked in separate thread.
Definition: status_bus_impl.cpp:21
~StatusBusImpl() override
Definition: status_bus_impl.cpp:13
rxcpp::composite_subscription cs_
Definition: status_bus_impl.hpp:29
Definition: status_bus_impl.hpp:16
StatusBusImpl(rxcpp::observe_on_one_worker worker=rxcpp::observe_on_new_thread())
Definition: status_bus_impl.cpp:10
Definition: block_query.hpp:16
rxcpp::observe_on_one_worker worker_
Definition: status_bus_impl.hpp:28
Definition: status_bus.hpp:17