diff --git a/src/lib/orderman/OrderServiceServer.cpp b/src/lib/orderman/OrderServiceServer.cpp index 295c82b85..701f85495 100644 --- a/src/lib/orderman/OrderServiceServer.cpp +++ b/src/lib/orderman/OrderServiceServer.cpp @@ -232,9 +232,10 @@ OrderServiceServer::OrderServiceServer( this->on_order_op_result(order_op_result); }); }, - [](const ExchangePosition &exch_pos) { + [this, &ctx](const ExchangePosition &exch_pos) { LOG(OrderMan, Info, "OrderServiceServer exchange position n_pos: {} ", exch_pos.total_exchange_positions.size()); + ctx.post([this, exch_pos] { this->_on_exchange_position(exch_pos); }); }, me->dyn_order_registry, thread->executor.make_proxy(), mdc.oracle()); @@ -408,5 +409,11 @@ void OrderServiceServer::on_order_op_result( me->in_flight_order_ops.erase(it); } +void OrderServiceServer::_on_exchange_position( + const ExchangePositionEvent &ev) { + LOG(OrderMan, Info, "OrderServiceServer::_on_exchange_position n_pos: {}", + ev.position.total_exchange_positions.size()); +} + } // namespace orderman } // namespace bts diff --git a/src/lib/orderman/OrderServiceServer.h b/src/lib/orderman/OrderServiceServer.h index f2640ea6a..995a79e0c 100644 --- a/src/lib/orderman/OrderServiceServer.h +++ b/src/lib/orderman/OrderServiceServer.h @@ -19,6 +19,7 @@ class MetricsContainer; namespace orderman { class DynamicOrderRegistry; class OrderOpResultEvent; +class ExchangePositionEvent; class OrderServiceServer : public api::orderman::OrderServiceBase { public: @@ -54,6 +55,7 @@ class OrderServiceServer : public api::orderman::OrderServiceBase { void on_orders(std::vector const &); void on_fills(std::vector const &); void on_order_op_result(OrderOpResultEvent const &); + void _on_exchange_position(const ExchangePositionEvent &); }; } // namespace orderman