示例#1
0
		private Event CreateEvent(string stream, int version) {
			var originalName = StreamNamesGenerator.GetOriginalName(stream);
			var factory = CorrespondingProducer(originalName);

			Event generated;
			lock (_factoryLock)
				generated = factory.Create(version);

			return generated;
		}
示例#2
0
		private bool Equal(string stream, int expectedIdx, string eventType, byte[] actual) {
			var originalName = StreamNamesGenerator.GetOriginalName(stream);
			var producer = CorrespondingProducer(originalName);

			bool equal;
			lock (_factoryLock)
				equal = producer.Equal(expectedIdx, eventType, actual);

			return equal;
		}
示例#3
0
		private bool Run(CommandProcessorContext context, int writers, int readers, int events, int streams) {
			context.IsAsync();

			_streams = new string[streams * Producers.Length];
			for (var i = 0; i < Producers.Length; i++) {
				for (var j = i * streams; j < streams * (i + 1); j++) {
					_streams[j] = StreamNamesGenerator.GenerateName(Producers[i].Name, j - i * streams);
				}
			}

			_heads = Enumerable.Repeat(-1, streams * Producers.Length).ToArray();

			return Verify(context, writers, readers, events);
		}