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 #include <rxcpp/rx-lite.hpp>
12 
13 #include <rxcpp/operators/rx-observe_on.hpp>
14 
15 namespace iroha {
16  namespace torii {
20  class StatusBusImpl : public StatusBus {
21  public:
23  rxcpp::observe_on_one_worker worker = rxcpp::observe_on_new_thread());
24 
25  ~StatusBusImpl() override;
26 
27  void publish(StatusBus::Objects) override;
29  rxcpp::observable<StatusBus::Objects> statuses() override;
30 
31  // Need to create once, otherwise will create thread for each subscriber
32  rxcpp::observe_on_one_worker worker_;
33  rxcpp::composite_subscription cs_;
34  rxcpp::subjects::synchronize<StatusBus::Objects, decltype(worker_)>
36  };
37  } // namespace torii
38 } // namespace iroha
39 
40 #endif // TORII_STATUS_BUS_IMPL
Definition: command_client.hpp:16
rxcpp::subjects::synchronize< StatusBus::Objects, decltype(worker_)> subject_
Definition: status_bus_impl.hpp:35
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:33
Definition: status_bus_impl.hpp:20
StatusBusImpl(rxcpp::observe_on_one_worker worker=rxcpp::observe_on_new_thread())
Definition: status_bus_impl.cpp:10
Definition: block_query.hpp:15
rxcpp::observe_on_one_worker worker_
Definition: status_bus_impl.hpp:32
Definition: status_bus.hpp:17