ThreadedBB funciton name change

This commit is contained in:
Taha Afzal authored and John Colvin committed 2021-12-21 14:31:20 -05:00
1 parent 85c0e7780f
commit 9f28ef19ef
15 files changed
+25 -30

No files matched your search

@@ -56,7 +56,7 @@ namespace mbts.spark {
}
break;
}
_bb.sec_thread_write(SparkTags.ExpirationParametersInputTag,
_bb.post(SparkTags.ExpirationParametersInputTag,
new AnalyticsExpirationParametersMap(to_publish));
}
@@ -74,7 +74,7 @@ namespace mbts.spark {
}
}
OptionDriverPriceMap final_res = new OptionDriverPriceMap(_sec_tup.security_name, res);
_bb.sec_thread_write(SparkTags.OptionDriverBBOTag(_sec_tup.security_name), final_res);
_bb.post(SparkTags.OptionDriverBBOTag(_sec_tup.security_name), final_res);
}
}
}
@@ -24,12 +24,12 @@ namespace mbts.spark {
public void publish(IDictionary<VolSurfaceExpiration, IEnumerable<Theos>> exp_theo_map) {
if (_n_updates == 0)
/// If its the first theos send it rightaway
_bb.sec_thread_write(SparkTags.VolSurfaceLocalTheosTag(_vs_id), exp_theo_map);
_bb.post(SparkTags.VolSurfaceLocalTheosTag(_vs_id), exp_theo_map);
else {
if (_is_theo_acceptance_confirmation_on)
_bb.sec_thread_write(SparkTags.VolSurfaceTheoAlertTag, new VolSurfaceTheoAlertData(Guid.NewGuid().ToString(), _vs_id, exp_theo_map));
_bb.post(SparkTags.VolSurfaceTheoAlertTag, new VolSurfaceTheoAlertData(Guid.NewGuid().ToString(), _vs_id, exp_theo_map));
else
_bb.sec_thread_write(SparkTags.VolSurfaceLocalTheosTag(_vs_id), exp_theo_map);
_bb.post(SparkTags.VolSurfaceLocalTheosTag(_vs_id), exp_theo_map);
}
_n_updates++;
}
@@ -56,7 +56,7 @@ namespace mbts.spark {
VolSurfaceOutput vs_output = GeneralVolSurfaceCalculator.compute(vs_input, vs_nonvol_data.contracts, aux_data_map);
_timer.stop();
_logger.log(_log_id, _log_id, _timer.lastIntervalTime);
_bb.sec_thread_write(_out_bb_computed_vol_tag, vs_output);
_bb.post(_out_bb_computed_vol_tag, vs_output);
}
}
@@ -80,7 +80,7 @@ namespace mbts.spark {
if (_source != null)
_source.Dispose();
_source = _create_func(_option_symbols);
_bb.sec_thread_write(SparkTags.AquireTag(Guid.NewGuid().ToString()),
_bb.post(SparkTags.AquireTag(Guid.NewGuid().ToString()),
new SymbolResourceAllocationUnit(
_option_symbols.Select(i => new mbts.SecurityTuple(SecurityType.Option, i, Venue.Unset)), this, true));
}
@@ -49,7 +49,7 @@ namespace mbts.spark {
all_vss = all_vss.Where(vs => vs.VsId == _volsurface_id);
VolSurfaceEntryImmutable vs = all_vss.MaxElement(vs => vs.SaveTime);
VolSurfaceInput vs_input = _to_vs_input(vs);
_threaded_bb.sec_thread_write(
_threaded_bb.post(
SparkTags.VolSurfaceCommittedInputTag(_volsurface_id), vs_input, false);
_update_publish_snapshots(all_vss);
}
@@ -61,7 +61,7 @@ namespace mbts.spark {
_snp_shot_map.Add(vse.SaveTime, snp);
}
}
_threaded_bb.sec_thread_write(SparkTags.VolSurfaceInputSnapshotListTag(_volsurface_id),
_threaded_bb.post(SparkTags.VolSurfaceInputSnapshotListTag(_volsurface_id),
_snp_shot_map.Values);
}
@@ -84,7 +84,7 @@ namespace mbts.spark {
Log.Gen.info(String.Format("Time to commit volsurface {0} {1} msecs", _volsurface_id, _timer.lastIntervalTime));
} catch (Exception ex) {
Log.Gen.warn(ex.ToString());
_threaded_bb.sec_thread_write(SparkTags.MessageDisplayTag,
_threaded_bb.post(SparkTags.MessageDisplayTag,
new MessageDisplayData("Vol Surface Addition",
String.Format("Could not create Vol Surface, Error : {0}", ex.Message)));
}
@@ -138,7 +138,7 @@ namespace mbts.spark {
_ignore_market_implied_vol_source_settings(_bb, _vs_id), out md_exp);
_timer.stop();
_logger.log("SingleVolSurfaceMarketImpliedVolSource", "SingleVolSurfaceMarketImpliedVolSource", _timer.lastIntervalTime);
_bb.sec_thread_write(SparkTags.VolSurfaceMarketImpliedVolTag(_vs_id),
_bb.post(SparkTags.VolSurfaceMarketImpliedVolTag(_vs_id),
new Dictionary<VolSurfaceExpiration, Tuple<VolSurfaceExpiration, VolCurveMarketImpliedVolData>>() { { orig_exp, Tuple.Create(md_exp, exp_impl_vol_map) } });
}
}
@@ -48,7 +48,7 @@ namespace mbts.spark {
foreach (string s in _option_symbols)
foreach (var kv in contract_data.get_option_strikes(s))
_sec_map[new VolSurfaceExpiration() { symbol = s, expiration = kv.Key }] = kv.Value;
_bb.sec_thread_write(_out_bb_vs_contracts_tag, new VolSurfaceStrikeMap(_sec_map));
_bb.post(_out_bb_vs_contracts_tag, new VolSurfaceStrikeMap(_sec_map));
_recompute_and_fire();
} else if (_in_bb_vs_nonvol_input_tag.Equals(tag) || _in_bb_driver_price_tag.Equals(tag))
_recompute_and_fire();
@@ -58,7 +58,7 @@ namespace mbts.spark {
VolSurfaceNonVolInput vs_nonvol_input = _bb.sec_thread_retrieve_from_cache(_in_bb_vs_nonvol_input_tag) as VolSurfaceNonVolInput;
var price_map = _bb.sec_thread_retrieve_from_cache(_in_bb_driver_price_tag) as IDictionary<VolSurfaceExpiration, double>;
if (_sec_map != null && vs_nonvol_input != null && price_map != null)
_bb.sec_thread_write(_out_bb_vs_nonvol_data_tag, new VolSurfaceNonVolData(vs_nonvol_input, price_map, _sec_map));
_bb.post(_out_bb_vs_nonvol_data_tag, new VolSurfaceNonVolData(vs_nonvol_input, price_map, _sec_map));
}
#region IDisposable
@@ -61,7 +61,7 @@ namespace mbts.spark {
private void _on_timer() {
if (_option_driver_dirty) {
_option_driver_dirty = false;
_threaded_bb.sec_thread_write(_out_bb_driver_price_tag,
_threaded_bb.post(_out_bb_driver_price_tag,
new Dictionary<VolSurfaceExpiration, double>(_option_driver_price_map));
}
}
@@ -84,7 +84,7 @@ namespace mbts.spark {
effective_req.cascade_up, effective_req.cascade_down);
_timer.stop();
bts.Log.Gen.info(String.Format("SingleVolSurfaceRequestCalculator. Time to compute vol for {0} exps {1} msecs", nonvol_data.contracts.Count, _timer.lastIntervalTime));
_threaded_bb.sec_thread_write(SparkTags.VolSurfaceCalculationResponseTag(_vs_id), new VolSurfaceCalculationResponse(_last_output, effective_req.request_id));
_threaded_bb.post(SparkTags.VolSurfaceCalculationResponseTag(_vs_id), new VolSurfaceCalculationResponse(_last_output, effective_req.request_id));
}
}
}
@@ -77,7 +77,7 @@ namespace mbts.spark {
}
var new_data = new VolSurfaceTheoData(secs, comm_theo_map, cand_theo_map, is_active_candidate);
if (_is_valid_update(new_data))
_bb.sec_thread_write(SparkTags.VolSurfaceTheoOutputTag(_volsurface_id), new_data);
_bb.post(SparkTags.VolSurfaceTheoOutputTag(_volsurface_id), new_data);
}
private bool _is_valid_update(VolSurfaceTheoData new_data) {
@@ -30,7 +30,7 @@ namespace mbts.spark
// r.get_datetime("server_time"),
// r.get_datetime("server_time_utc"));
mbts.analytics.VolSurfaceStandardTime time = new VolSurfaceStandardTime(TimeZoneInfo.Utc, DateTime.Now, DateTime.Now);
_bb.sec_thread_write(SparkTags.VolSurfaceStandardTimeTag(_vs_id), time);
_bb.post(SparkTags.VolSurfaceStandardTimeTag(_vs_id), time);
}
#region IDisposable
@@ -71,7 +71,7 @@ namespace mbts.spark {
foreach (VolSurfaceUsageListImmutable l in update.all) {
to_write = l;
}
_threaded_bb.sec_thread_write(SparkTags.VolSurfaceUsageTag, to_write);
_threaded_bb.post(SparkTags.VolSurfaceUsageTag, to_write);
}
void _on_vss(bts.api.core.Update<VolSurfaceEntryImmutable, UInt64> update) {
@@ -80,7 +80,7 @@ namespace mbts.spark {
foreach (VolSurfaceEntryImmutable vs in update.all) {
to_publish[vs.VsId] = vs.VsName;
}
_threaded_bb.sec_thread_write(SparkTags.VolSurfaceListTag, to_publish);
_threaded_bb.post(SparkTags.VolSurfaceListTag, to_publish);
_check_for_activation(to_publish.Keys);
}
@@ -109,13 +109,13 @@ namespace mbts.spark {
_analytics_service.delete_volsurface(vs_id_w);
} catch (Exception ex) {
Log.Gen.error(String.Format("Vol Surface deletion failed with exception:{0}", ex.Message));
_threaded_bb.sec_thread_write(SparkTags.MessageDisplayTag, new MessageDisplayData("Vol Surface Deletion",
_threaded_bb.post(SparkTags.MessageDisplayTag, new MessageDisplayData("Vol Surface Deletion",
String.Format("Could not delete Vol Surface, Error : {0}", ex.Message)));
}
} else if (_in_bb_exp_params_tag.Equals(tag)) {
AnalyticsExpirationParametersMap exp_param_map = data as AnalyticsExpirationParametersMap;
// TODO, add whatever else is needed to AnalyticsExpirationParametersMap -> VolSurfaceNonVolInputTag
_threaded_bb.sec_thread_write(SparkTags.VolSurfaceNonVolInputTag,
_threaded_bb.post(SparkTags.VolSurfaceNonVolInputTag,
new mbts.analytics.VolSurfaceNonVolInput(exp_param_map.exp_map.ToDictionary()));
}
}
@@ -137,7 +137,7 @@ namespace mbts.spark {
vs_input.surface_settings.core_settings.vol_surface_id = reply.NewId;
ResultMessage res = VolSurfaceUtilityFunctions.save_volsurface(vs_input, _analytics_service);
if (res.Success) {
_threaded_bb.sec_thread_write(SparkTags.VolSurfaceActivationTag(reply.NewId), true, false);
_threaded_bb.post(SparkTags.VolSurfaceActivationTag(reply.NewId), true, false);
} else {
err_txt = res.ErrorMessage;
}
@@ -146,7 +146,7 @@ namespace mbts.spark {
}
if (err_txt != null) {
Log.Gen.error(String.Format("Vol Surface creation failed with message:{0}", err_txt));
_threaded_bb.sec_thread_write(SparkTags.MessageDisplayTag, new MessageDisplayData("Vol Surface Addition",
_threaded_bb.post(SparkTags.MessageDisplayTag, new MessageDisplayData("Vol Surface Addition",
String.Format("Could not create Vol Surface, Error : {0}", err_txt)));
}
}
@@ -36,17 +36,12 @@ namespace mbts.spark {
public Action timer_callback;
#region Templatized sub/write
public void add_to_subscription_list<T>(ITag<T> tag) {
var observable = _bus.subscribe(tag).OnDispatcher().Subscribe(
data => _on_bus_data(tag, data));
}
public void subscribe<T>(ITag<T> tag) {
var observable = _bus.subscribe(tag).OnDispatcher().Subscribe(
data => _on_bus_data(tag, data));
}
public void sec_thread_write<T>(ITag<T> tag, T data, bool block_until_written = false) {
public void post<T>(ITag<T> tag, T data, bool block_until_written = false) {
_bus.post(tag, data);
}
@@ -65,7 +65,7 @@ namespace mbts.spark {
foreach (var kv in theo_map) {
string option_name = kv.Key;
if (_vs_usage_map.symbol_driven_by_vs(option_name, vs_id)) {
_bb.sec_thread_write(SparkTags.PrecomputedOptionTheoTag(option_name), kv.Value);
_bb.post(SparkTags.PrecomputedOptionTheoTag(option_name), kv.Value);
}
}
}