コード例 #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);
 }
コード例 #5
0
 public static void NotifySubscriptionData(this SubscriptionFuture future, RtmSubscriptionData data)
 {
     future?.Observer.NotifySubscriptionData(future, data);
 }
コード例 #6
0
        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);
                }
            }
        }
コード例 #7
0
 public static void NotifySubscriptionData(this ISubscriptionObserver observer, ISubscription subscription, RtmSubscriptionData data)
 {
     if (observer != null)
     {
         observer.OnSubscriptionData(subscription, data);
     }
 }