Пример #1
0
        private void SubscribeToConnectionChanged()
        {
            redisSubscriber.WhenIsConnectedChanges
            .Subscribe(isConnected =>
            {
                if (isConnected)
                {
                    SubscribeToStatusChanges();
                }
                else
                {
                    statusChangesSubscription.Disposable = Disposable.Empty;

                    lastStatus = new VersionedTableDependencyStatus(VersionedTableDependencyStatus.TableDependencyStatuses.None, DateTimeOffset.MinValue);

                    reactiveData.Publish(lastStatus);
                }
            })
            .DisposeWith(CompositeDisposable);
        }
Пример #2
0
 private void PublishStatusChanged(VersionedTableDependencyStatus.TableDependencyStatuses status)
 {
     reactiveData.Publish(new VersionedTableDependencyStatus(
                              status, DateTimeOffset.Now));
 }