public void when_get()
        {
            var manager = new DuplicationManager();
            var memory1 = manager.GetOrAdd("dispatcher");
            var memory2 = manager.GetOrAdd("dispatcher");

            Assert.AreEqual(memory1, memory2);
        }
Beispiel #2
0
 public EnvelopeDispatcher(Action<ImmutableEnvelope> action, IEnvelopeStreamer streamer, IEnvelopeQuarantine quarantine, DuplicationManager manager, string dispatcherName)
 {
     _action = action;
     _quarantine = quarantine;
     _dispatcherName = dispatcherName;
     _manager = manager.GetOrAdd(this);
     _streamer = streamer;
 }
 public void SetUp()
 {
     _testEnvelopeStreamer = new TestEnvelopeStreamer(new byte[] { 1, 2, 3 });
     _testEnvelopeQuarantine = new TestEnvelopeQuarantine();
     _duplicationManager = new DuplicationManager();
     _envelopeDispatcher = new EnvelopeDispatcher(e => { ActionCalled = true; }, _testEnvelopeStreamer, _testEnvelopeQuarantine,
                                                  _duplicationManager, "D1");
 }
        public CqrsEngineBuilder(IEnvelopeStreamer streamer, IEnvelopeQuarantine quarantine = null, DuplicationManager duplication = null)
        {
            Processes = new List<IEngineProcess>();
            Streamer = streamer;
            Quarantine = quarantine ?? new MemoryQuarantine();
            Duplication = duplication ?? new DuplicationManager();

            Processes.Add(Duplication);
        }
 public FluentCqrsEngineBuilder(IEnvelopeStreamer streamer, IEnvelopeQuarantine quarantine = null, DuplicationManager duplication = null)
 {
     _builder = new CqrsEngineBuilder(streamer, quarantine, duplication);
 }
Beispiel #6
0
 public EnvelopeDispatcher(Action <ImmutableEnvelope> action, IEnvelopeStreamer streamer, IEnvelopeQuarantine quarantine, DuplicationManager manager, string dispatcherName)
 {
     this._action         = action;
     this._quarantine     = quarantine;
     this._dispatcherName = dispatcherName;
     this._manager        = manager.GetOrAdd(this);
     this._streamer       = streamer;
 }