Merge remote-tracking branch 'origin/master' into SPARK-1944-attach/detach/update
This commit is contained in:
commit
7bd9d3f4ad
114 files changed
+2323
-1491
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include "lib/config/protos/jetfix.pb.h"
|
||||
#include "lib/config/protos/orderman_cfg.pb.h"
|
||||
#include "lib/md/MDConsumer.h"
|
||||
#include "lib/md/MDClient.h"
|
||||
#include "lib/mercury/actors/Timer.h"
|
||||
#include "lib/mercury/executor/Executor.h"
|
||||
#include "lib/metrics/metrics.h"
|
||||
@@ -89,12 +90,12 @@ ActorThread *find_thread_for_actor(
|
||||
|
||||
struct OrderServiceServer::PImpl {
|
||||
PImpl(bts::api::ServiceContext &ctx,
|
||||
std::shared_ptr<api::ISyntheticSecurityService> &ss,
|
||||
md::MDClient& mdc,
|
||||
DynamicOrderRegistry const &d, metrics::MetricsContainer &stats,
|
||||
trace::PerfLog &log)
|
||||
: service_bridge(), service_ready(false), known_orders(), known_fills(),
|
||||
publish_orders(), publish_fills(),
|
||||
admin_service(ctx.locate<api::admin::AdminService>()), md_consumer(ss),
|
||||
admin_service(ctx.locate<api::admin::AdminService>()), md_consumer(mdc.current_consumer()),
|
||||
stats(stats), dyn_order_registry(d), log(log), in_flight_order_ops(),
|
||||
current_req_op_id(0) {}
|
||||
|
||||
@@ -109,7 +110,7 @@ struct OrderServiceServer::PImpl {
|
||||
OrderServiceServer::OrdersPublisher publish_orders;
|
||||
OrderServiceServer::FillsPublisher publish_fills;
|
||||
api::admin::AdminService admin_service;
|
||||
bts::md::MDConsumer md_consumer;
|
||||
bts::md::MDConsumer& md_consumer;
|
||||
metrics::MetricsContainer &stats;
|
||||
DynamicOrderRegistry const &dyn_order_registry;
|
||||
trace::PerfLog &log;
|
||||
@@ -120,12 +121,10 @@ struct OrderServiceServer::PImpl {
|
||||
|
||||
OrderServiceServer::OrderServiceServer(
|
||||
bts::api::ServiceContext &ctx,
|
||||
std::shared_ptr<api::ISyntheticSecurityService> &ss,
|
||||
md::MDClient& mdc,
|
||||
DynamicOrderRegistry const &d, metrics::MetricsContainer &stats,
|
||||
trace::PerfLog &log)
|
||||
: api::orderman::OrderServiceBase(ctx),
|
||||
me(new PImpl(ctx, ss, d, stats, log)) {
|
||||
|
||||
: api::orderman::OrderServiceBase(ctx), me(new PImpl(ctx, mdc, d, stats,log)) {
|
||||
me->publish_orders = make_orders_publisher();
|
||||
me->publish_fills = make_fills_publisher();
|
||||
|
||||
@@ -144,6 +143,7 @@ OrderServiceServer::OrderServiceServer(
|
||||
bts_assert_msg(thread,
|
||||
"Could not find a configured thread for MDSource. See the "
|
||||
"OrdermanCfg key");
|
||||
|
||||
thread->executor.spawn<MDSource>(me->md_consumer, me->stats, log);
|
||||
|
||||
// OrderManager
|
||||
@@ -151,7 +151,7 @@ OrderServiceServer::OrderServiceServer(
|
||||
bts_assert_msg(thread,
|
||||
"Could not find a configured thread for OrderManager. See "
|
||||
"the OrdermanCfg key");
|
||||
thread->executor.spawn<OrderManager>(d, me->log);
|
||||
thread->executor.spawn<OrderManager>(d,me->log, mdc.oracle());
|
||||
|
||||
// Timer
|
||||
thread = find_thread_for_actor("Timer", me->actor_threads);
|
||||
@@ -165,21 +165,21 @@ OrderServiceServer::OrderServiceServer(
|
||||
bts_assert_msg(thread,
|
||||
"Could not find a configured thread for AsyncFactory. See "
|
||||
"the OrdermanCfg key");
|
||||
thread->executor.spawn<AsyncFactory>(d);
|
||||
thread->executor.spawn<AsyncFactory>(d, mdc.oracle());
|
||||
|
||||
// OrderStore
|
||||
thread = find_thread_for_actor("OrderStore", me->actor_threads);
|
||||
bts_assert_msg(thread,
|
||||
"Could not find a configured thread for OrderStore. See "
|
||||
"the OrdermanCfg key");
|
||||
thread->executor.spawn<OrderStore>();
|
||||
thread->executor.spawn<OrderStore>(mdc.oracle());
|
||||
|
||||
// FillStore
|
||||
thread = find_thread_for_actor("FillStore", me->actor_threads);
|
||||
bts_assert_msg(thread,
|
||||
"Could not find a configured thread for FilllStore. See "
|
||||
"the OrdermanCfg key");
|
||||
thread->executor.spawn<FillStore>();
|
||||
thread->executor.spawn<FillStore>(mdc.oracle());
|
||||
|
||||
// SecuritySrc
|
||||
thread = find_thread_for_actor("SecuritySrc", me->actor_threads);
|
||||
@@ -203,22 +203,20 @@ OrderServiceServer::OrderServiceServer(
|
||||
"the OrdermanCfg key");
|
||||
me->service_bridge = new ServiceBridge(
|
||||
[this]() { me->service_ready = true; },
|
||||
|
||||
[this, &ctx](auto const &orders) {
|
||||
ctx.post([this, orders] { this->on_orders(orders); });
|
||||
},
|
||||
|
||||
[this, &ctx](auto const &fill) {
|
||||
ctx.post([this, fill] { this->on_fills(fill); });
|
||||
},
|
||||
|
||||
[this, &ctx](auto const &order_op_result) {
|
||||
ctx.post([this, order_op_result] {
|
||||
this->on_order_op_result(order_op_result);
|
||||
});
|
||||
},
|
||||
me->dyn_order_registry,
|
||||
thread->executor.make_proxy(),mdc.oracle());
|
||||
|
||||
me->dyn_order_registry, thread->executor.make_proxy());
|
||||
|
||||
thread->executor.activate(me->service_bridge);
|
||||
|
||||
|
||||
Reference in new issue
Block a user