Ejemplo n.º 1
0
 internal GossipBackend(ITransport transport, GossipConfiguration configuration, object owner)
 {
     _owner                   = owner ?? this;
     Transport                = transport ?? throw new ArgumentNullException(nameof(transport));
     Configuration            = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _freshIndex              = new ReverseTimeIndex(GetItemDirect);
     _gossipTimer             = new Timer(_ => SpreadRumors(), null, Configuration.GossipInterval, Configuration.GossipInterval);
     _deletableTimer          = new Timer(GetDeletableTimerMethod(), null, Configuration.CleanUpInterval, Configuration.CleanUpInterval);
     _applyMethods            = new ApplyMethods((key, fi) => SetInternal(key, fi));
     Transport.MessageHandler = Transport_MessageHandler;
 }
Ejemplo n.º 2
0
 public Enumerator(ReverseTimeIndex owner)
 {
     _currentItemGetter = owner._currentItemGetter;
     _current           = owner._listHead.Value;
     _open = false;
 }