public ProjectionDispatcherTest(ITestOutputHelper output) { var converter = new Converter(output); Console.SetOut(converter); World = World.StartWithDefaults("test-store"); var stateAdapterProvider = new StateAdapterProvider(World); stateAdapterProvider.RegisterAdapter(new Entity1StateAdapter()); new EntryAdapterProvider(World); StateTypeStateStoreMap.StateTypeToStoreName(nameof(Entity1), typeof(Entity1)); StateTypeStateStoreMap.StateTypeToStoreName(nameof(Entity2), typeof(Entity2)); var dispatcherProtocols = World.Stage.ActorFor( new[] { DispatcherInterfaceType, typeof(IProjectionDispatcher) }, ProjectionDispatcherType); var dispatchers = Protocols.Two <IDispatcher, IProjectionDispatcher>(dispatcherProtocols); Dispatcher = dispatchers._1; ProjectionDispatcher = dispatchers._2; var storeProtocols = World.ActorFor( new[] { StateStoreInterfaceType, typeof(IDispatcherControl) }, typeof(InMemoryStateStoreActor <TextState>), Dispatcher); var storeWithControl = Protocols.Two <IStateStore, IDispatcherControl>(storeProtocols); Store = storeWithControl._1; DispatcherControl = storeWithControl._2; }
public InMemoryObjectStoreActor(IDispatcher dispatcher, long checkConfirmationExpirationInterval, long confirmationExpiration) { _entryAdapterProvider = EntryAdapterProvider.Instance(Stage.World); _dispatcher = dispatcher; _entryReaders = new Dictionary <string, IObjectStoreEntryReader>(); _storeDelegate = new InMemoryObjectStoreDelegate(StateAdapterProvider.Instance(Stage.World)); _dispatcherControl = Stage.ActorFor <IDispatcherControl>( () => new DispatcherControlActor(dispatcher, _storeDelegate, checkConfirmationExpirationInterval, confirmationExpiration)); }
public InMemoryJournal(IDispatcher dispatcher, World world, long checkConfirmationExpirationInterval = 1000L, long confirmationExpiration = 1000L) : this(new [] { dispatcher }, world, checkConfirmationExpirationInterval, confirmationExpiration) { }
public InMemoryStateStoreActor(IDispatcher dispatcher, long checkConfirmationExpirationInterval, long confirmationExpiration) : this(new [] { dispatcher }, checkConfirmationExpirationInterval, confirmationExpiration) { }
public InMemoryStateStoreActor(IDispatcher dispatcher) : this(new [] { dispatcher }, 1000L, 1000L) { }
/// <summary> /// Construct my default state. /// </summary> /// <param name="dispatcher">The dispatcher to be used</param> public InMemoryObjectStoreActor(IDispatcher dispatcher) : this(dispatcher, 1000L, 1000L) { }