Added commented to document flow of ExchangePosition

This commit is contained in:
taha afzal committed 2022-05-24 12:24:47 -04:00
1 parent b9a4a2c148
commit 896af55e79
1 file changed
+18 -9
+18 -9
View File
@@ -15,15 +15,24 @@
// IEMOrderMuxer through which all orders are sent out and callbacks reveived to
// the and from the outside world.
// Callbacks are send back to the OrderManager via the 4 callback functions. The
// path that ExchangePosition takes to the OrderService is as follows:
// IEMOrderMuxer -> EMExecutionGateway (in IEMOrderMuxer's thread, IEMOrderMuxer
// exposes exchange_position_update_cb that EMExecutionGateway sets to its own
// function) EMExecutionGateway -> OrderManager (via
// on_exchange_position_state, which is exposed by EMExecutionGateway that
// OrderManager sets to its own callback function) OrderManager -> ServiceBridge
// (via Stream<ExchangePositionEvent>) ServiceBridge -> OrderServiceServer (via
// callback passed in ServiceBridge's constructor)
// Callbacks are sent back to the OrderManager via the 4 callback functions.
// The path that ExchangePosition takes to the OrderService is as follows:
// 1. IEMOrderMuxer -> EMExecutionGateway (data: const
// std::vector<emumba::order_entry::position>)
// 2. EMExecutionGateway -> OrderManager (ExchangePosition)
// (the above 2 are implemented via the source exposing an std::func that the
// destination sets to its own function, ex, EMExecutionGateway doing this:
// me->order_mux->exchange_position_update_cb() = []() { ... }
// and OrderManager doing this:
// s->gw->on_exchange_position_state() =[](){ ... }
// 3. OrderManager -> ServiceBridge (via publishing
// Stream<ExchangePositionEvent>)
// 4. ServiceBridge -> OrderServiceServer (via callback passed in
// ServiceBridge's constructor)
// (ServiceBridge is constructed by the OrderServiceServer. It listens to the
// event published by the OrderManager, and calls the lambda passed by the
// OrderServiceServer wihle constructing OrderManager)
namespace emumba::deribit_connector::data_types {
class error;