public InMemoryPersistence(INetworkSimulator networkSimulator, Func <object, object> cloneFunc) { _chunks = new Chunk[1024 * 1024]; _cloneFunc = cloneFunc ?? (o => o); _networkSimulator = networkSimulator ?? new NoNetworkLatencySimulator(); _emptyInMemoryPartition = new InMemoryPartition("::empty", _networkSimulator, Clone); _partitions.TryAdd(_emptyInMemoryPartition.Id, _emptyInMemoryPartition); }
public InMemoryPersistence(InMemoryPersistenceOptions options) { _chunks = new MemoryChunk[1024 * 1024]; _options = options; _cloneFunc = _options.CloneFunc ?? (o => o); _networkSimulator = _options.NetworkSimulator ?? new NoNetworkLatencySimulator(); _emptyInMemoryPartition = new InMemoryPartition("::empty", _networkSimulator, Clone); _partitions.TryAdd(_emptyInMemoryPartition.Id, _emptyInMemoryPartition); }
public Projections(INetworkSimulator networkSimulator) { Rooms = new RoomsOnSaleProjection( new ColoredConsoleReporter("rooms on sale", ConsoleColor.Cyan), networkSimulator ); Bookings = new ConfirmedBookingsProjection( new ColoredConsoleReporter("confirmed bookings", ConsoleColor.Cyan), networkSimulator ); Setup(); }
public AppProjections(INetworkSimulator network, bool quiet) { _quiet = quiet; Rooms = new RoomsOnSaleProjection( _quiet ? NullReporter.Instance : new ColoredConsoleReporter("rooms on sale", ConsoleColor.Red), network ); Bookings = new ConfirmedBookingsProjection( _quiet ? NullReporter.Instance : new ColoredConsoleReporter("confirmed bookings", ConsoleColor.Cyan), network ); Setup(); }
public ConfirmedBookingsProjection(IReporter reporter, INetworkSimulator networkSimulator) { this._reporter = reporter; _networkSimulator = networkSimulator; }
public InMemoryPersistence(INetworkSimulator networkSimulator) : this(networkSimulator, null) { }
public RoomsOnSaleProjection(IReporter reporter, INetworkSimulator networkSimulator) { _reporter = reporter; _networkSimulator = networkSimulator; }
public InMemoryPartition(string partitionId, INetworkSimulator networkSimulator, Func <Chunk, Chunk> clone) { this.Id = partitionId; _networkSimulator = networkSimulator; Clone = clone; }
public InMemoryPersistence(INetworkSimulator networkSimulator) : this(new InMemoryPersistenceOptions(null, networkSimulator)) { }
public InMemoryPersistenceOptions(Func <object, object> cloneFunc, INetworkSimulator networkSimulator) { CloneFunc = cloneFunc; NetworkSimulator = networkSimulator; }
private readonly INStoreLoggerFactory _loggerFactory = new ConsoleLoggerFactory(); // NStoreNullLoggerFactory.Instance; public ProjectionEngine(IPersistence persistence, INetworkSimulator networkSimulator) { _pollingClient = new PollingClient(persistence, 0, new Projections(networkSimulator), _loggerFactory); }