/// <summary> /// Invoked when odds change message is received /// </summary> /// <param name="sender">The instance raising the event</param> /// <param name="e">The event arguments</param> protected virtual void OnOddsChangeReceived(object sender, OddsChangeEventArgs <ISportEvent> e) { var oddsChange = e.GetOddsChange(); FeedMessages.Add(new FMessage(oddsChange.Timestamps.Created, oddsChange.Event, "OddsChange")); WriteMessageData((IOddsFeedSession)sender, e.GetOddsChange(), DateTime.Now); }
private void SessionOnOddsChange(object sender, OddsChangeEventArgs <ISportEvent> oddsChangeEventArgs) { var baseEntity = oddsChangeEventArgs.GetOddsChange(); WriteSportEntity(baseEntity.GetType().Name, baseEntity.Event); _marketWriter.WriteMarketNamesForEvent(baseEntity.Markets); }
/// <summary> /// Invoked when odds change message is received /// </summary> /// <param name="sender">The instance raising the event</param> /// <param name="e">The event arguments</param> protected virtual void OnOddsChangeReceived(object sender, OddsChangeEventArgs <T> e) { Guard.Argument(e, nameof(e)).NotNull(); var oddsChange = e.GetOddsChange(); _log.LogInformation($"OddsChange received. EventId:{oddsChange.Event.Id} Producer:{oddsChange.Producer} RequestId:{oddsChange.RequestId}"); _sportEntityWriter?.WriteData(oddsChange.Event); _marketWriter?.WriteMarketNamesForEvent(oddsChange.Markets); }
/// <summary> /// Invoked when odds change message is received /// </summary> /// <param name="sender">The instance raising the event</param> /// <param name="e">The event arguments</param> protected virtual void OnOddsChangeReceived(object sender, OddsChangeEventArgs <T> e) { Contract.Requires(e != null); var oddsChange = e.GetOddsChange(); _log.Info($"OddsChange received. EventId:{oddsChange.Event.Id} Producer:{oddsChange.Producer} RequestId:{oddsChange.RequestId}"); _sportEntityWriter?.WriteData(oddsChange.Event); _marketWriter?.WriteMarketNamesForEvent(oddsChange.Markets); }
/// <summary> /// Invoked when odds change message is received /// </summary> /// <param name="sender">The instance raising the event</param> /// <param name="e">The event arguments</param> protected virtual void OnOddsChangeReceived(object sender, OddsChangeEventArgs <T> e) { Guard.Argument(e, nameof(e)).NotNull(); using var t = SdkMetricsFactory.MetricsRoot.Measure.Timer.Time(_timerOnOddsChangeReceived, $"{e.GetOddsChange().Event.Id}"); var oddsChange = e.GetOddsChange(); _log.LogInformation($"OddsChange received. EventId:{oddsChange.Event.Id} Producer:{oddsChange.Producer.Name} RequestId:{oddsChange.RequestId}"); _sportEntityWriter?.WriteData(oddsChange.Event); _marketWriter?.WriteMarketNamesForEvent(oddsChange.Markets); _log.LogInformation($"OddsChange received. EventId:{oddsChange.Event.Id}. Processing took {t.Elapsed.TotalMilliseconds}ms."); }
private void SessionLowOnOddsChange(object sender, OddsChangeEventArgs <ISportEvent> oddsChangeEventArgs) { var baseEntity = oddsChangeEventArgs.GetOddsChange(); WriteLowSportEntity(baseEntity.GetType().Name, baseEntity.Event); }
/// <summary> /// Dispatches the <see cref="odds_change"/> message /// </summary> /// <param name="message">The <see cref="odds_change"/> message to dispatch</param> /// <param name="rawMessage">A raw message received from the feed</param> private void DispatchOddsChange(odds_change message, byte[] rawMessage) { var eventArgs = new OddsChangeEventArgs <T>(MessageMapper, message, DefaultCultures, rawMessage); Dispatch(OnOddsChange, eventArgs, message); }
private void SessionOnOddsChange(object sender, OddsChangeEventArgs <ISportEvent> oddsChangeEventArgs) { _messages.Add(oddsChangeEventArgs); }
/// <summary> /// Invoked when odds change message is received /// </summary> /// <param name="sender">The instance raising the event</param> /// <param name="e">The event arguments</param> private void OnOddsChangeReceived(object sender, OddsChangeEventArgs <ISportEvent> e) { // this method should never be invoked because the entity is always processed by a specific entity dispatcher throw new NotImplementedException(); }
private void SessionOnOddsChange(object sender, OddsChangeEventArgs <ISportEvent> oddsChangeEventArgs) { var baseEntity = oddsChangeEventArgs.GetOddsChange(); WriteSportEntity(baseEntity.GetType().Name, baseEntity.Event, baseEntity.Timestamps.Created); }