Internalized ExecutionGateway inside OrderManager.

This commit is contained in:
Pedro Pinto committed 2018-11-30 01:55:27 +00:00
1 parent e8f797739c
commit d3043e9a19
10 files changed
+143 -160

No files matched your search

+5 -14
View File
@@ -9,7 +9,6 @@
#include "lib/mercury/executor/Executor.h"
#include "lib/metrics/metrics.h"
#include "lib/orderman/actors/AsyncFactory.h"
#include "lib/orderman/actors/ExecutionGateway.h"
#include "lib/orderman/actors/FillStore.h"
#include "lib/orderman/actors/MDSource.h"
#include "lib/orderman/actors/MDSupplementarySource.h"
@@ -90,11 +89,11 @@ ActorThread *find_thread_for_actor(
struct OrderServiceServer::PImpl {
PImpl(bts::api::ServiceContext &ctx,
std::shared_ptr<api::ISyntheticSecurityService> &ss,
DynamicOrderRegistry const &d, metrics::MetricsContainer &stats)
DynamicOrderRegistry const &d, metrics::MetricsContainer &stats, PerfTraceLog &log)
: service_bridge(), service_ready(false), known_orders(), known_fills(),
publish_orders(), publish_fills(),
admin_service(ctx.locate<api::admin::AdminService>()), md_consumer(ss),
stats(stats), dyn_order_registry(d) {}
stats(stats), dyn_order_registry(d),log(log) {}
ServiceBridge *service_bridge;
@@ -110,6 +109,7 @@ struct OrderServiceServer::PImpl {
bts::md::MDConsumer md_consumer;
metrics::MetricsContainer &stats;
DynamicOrderRegistry const &dyn_order_registry;
PerfTraceLog &log;
};
OrderServiceServer::OrderServiceServer(
@@ -117,7 +117,7 @@ OrderServiceServer::OrderServiceServer(
std::shared_ptr<api::ISyntheticSecurityService> &ss,
DynamicOrderRegistry const &d, metrics::MetricsContainer &stats,
PerfTraceLog &log)
: api::orderman::OrderServiceBase(ctx), me(new PImpl(ctx, ss, d, stats)) {
: api::orderman::OrderServiceBase(ctx), me(new PImpl(ctx, ss, d, stats,log)) {
me->publish_orders = make_orders_publisher();
me->publish_fills = make_fills_publisher();
@@ -144,16 +144,7 @@ OrderServiceServer::OrderServiceServer(
bts_assert_msg(thread,
"Could not find a configured thread for OrderManager. See "
"the OrdermanCfg key");
thread->executor.spawn<OrderManager>(d);
// ExecutionGateway's
thread = find_thread_for_actor("ExecutionGateway", me->actor_threads);
bts_assert_msg(thread,
"Could not find a configured thread for ExecutionGateway "
"instances. See the OrdermanCfg key");
auto &all_connections = config::get<config::JetFIX>().connection();
for (auto const &c : all_connections)
thread->executor.spawn<ExecutionGateway>(c, log);
thread->executor.spawn<OrderManager>(d,me->log);
// Timer
thread = find_thread_for_actor("Timer", me->actor_threads);