Exemplo 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;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="transport">The message transport to use. The backend will dispose it when it gets disposed.</param>
 /// <param name="configuration">The configuration.</param>
 public GossipBackend(ITransport transport, GossipConfiguration configuration)
     : this(transport, configuration, null)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="transport">The message transport to use. The backend will dispose it when it gets disposed.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="logger">The logger to use.</param>
 public GossipBackend(ITransport transport, GossipConfiguration configuration, ILogger logger = null)
     : this(transport, configuration, null, logger)
 {
 }