/// <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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 5
0
        /// <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.");
        }
Esempio n. 6
0
        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);
        }
Esempio n. 8
0
 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();
 }
Esempio n. 10
0
        private void SessionOnOddsChange(object sender, OddsChangeEventArgs <ISportEvent> oddsChangeEventArgs)
        {
            var baseEntity = oddsChangeEventArgs.GetOddsChange();

            WriteSportEntity(baseEntity.GetType().Name, baseEntity.Event, baseEntity.Timestamps.Created);
        }