예제 #1
0
        public bool ProcessSubscriptionData(RtmSubscriptionData data)
        {
            Log.V("Processing subscription data, subscription: {0}, data: {1}", this, data);

            if (_state.ProcessSubscriptionData(data) != null)
            {
                this.NotifySubscriptionData(data);
                return(true);
            }

            return(false);
        }
예제 #2
0
            public State ProcessSubscriptionData(RtmSubscriptionData data)
            {
                Log.V("Processing subscription data, state: {0}, data: {1}", this, data);
                if (IsSubscribed)
                {
                    if (_awaiter.IsCompleted)
                    {
                        Log.V("Subscription data ignored because state is completed, state: {0}, data: {1}", this, data);
                        return(null);
                    }

                    if (_fsm.IsTrackPosition)
                    {
                        _fsm.Position = data.Position;
                    }

                    return(this);
                }

                Log.V("Subscription data ignored because state is not subscribed state, state: {0}, data: {1}", this, data);
                return(null);
            }
예제 #3
0
 public void OnSubscriptionData(ISubscription subscription, RtmSubscriptionData data)
 {
     _observers.NotifySubscriptionData(subscription, data);
 }
예제 #4
0
 void ISubscriptionObserver.OnSubscriptionData(ISubscription subscription, RtmSubscriptionData data)
 {
     OnSubscriptionData.InvokeSafe(subscription, data);
 }
 public static void NotifySubscriptionData(this SubscriptionFuture future, RtmSubscriptionData data)
 {
     future?.Observer.NotifySubscriptionData(future, data);
 }
        public static void NotifySubscriptionData(this IEnumerable <ISubscriptionObserver> observers, ISubscription subscription, RtmSubscriptionData data)
        {
            if (observers == null)
            {
                return;
            }

            foreach (var observer in observers)
            {
                try
                {
                    observer.OnSubscriptionData(subscription, data);
                }
                catch (Exception ex)
                {
                    UnhandledExceptionWatcher.Swallow(ex);
                }
            }
        }
 public static void NotifySubscriptionData(this ISubscriptionObserver observer, ISubscription subscription, RtmSubscriptionData data)
 {
     if (observer != null)
     {
         observer.OnSubscriptionData(subscription, data);
     }
 }