예제 #1
0
        public ReplicatorSpec(ReplicatorSpecConfig config)
            : base(config)
        {
            _config  = config;
            _cluster = Cluster.Cluster.Get(Sys);
            var settings = ReplicatorSettings.Create(Sys).WithGossipInterval(TimeSpan.FromSeconds(1.0)).WithMaxDeltaElements(10);
            var props    = Replicator.Props(settings);

            _replicator = Sys.ActorOf(props, "replicator");

            _timeOut       = Dilated(TimeSpan.FromSeconds(2.0));
            _writeTwo      = new WriteTo(2, _timeOut);
            _writeMajority = new WriteMajority(_timeOut);
            _writeAll      = new WriteAll(_timeOut);
            _readTwo       = new ReadFrom(2, _timeOut);
            _readMajority  = new ReadMajority(_timeOut);
            _readAll       = new ReadAll(_timeOut);
        }
예제 #2
0
        protected ReplicatorSpec(ReplicatorSpecConfig config)
            : base(config, typeof(ReplicatorSpec))
        {
            _config  = config;
            _first   = config.First;
            _second  = config.Second;
            _third   = config.Third;
            _cluster = Akka.Cluster.Cluster.Get(Sys);
            var settings = ReplicatorSettings.Create(Sys)
                           .WithGossipInterval(TimeSpan.FromSeconds(1.0))
                           .WithMaxDeltaElements(10);
            var props = Replicator.Props(settings);

            _replicator = Sys.ActorOf(props, "replicator");

            _timeOut       = Dilated(TimeSpan.FromSeconds(3.0));
            _writeTwo      = new WriteTo(2, _timeOut);
            _writeMajority = new WriteMajority(_timeOut);
            _writeAll      = new WriteAll(_timeOut);
            _readTwo       = new ReadFrom(2, _timeOut);
            _readMajority  = new ReadMajority(_timeOut);
            _readAll       = new ReadAll(_timeOut);
        }