static ExactlyOnceConfiguration RegisterServices(this IServiceCollection services) { var outboxConfiguration = new OutboxConfiguration(); var configuration = new ExactlyOnceConfiguration(outboxConfiguration); services.AddLogging(); services.AddSingleton <IOnceExecutor>(sp => { var stateStore = (IStateStore)sp.GetRequiredService(configuration.StateStoreType); var client = sp.GetRequiredService <CosmosClient>(); var outboxStore = new OutboxStore(client, outboxConfiguration); var processor = new ExactlyOnceProcessor(outboxStore, stateStore); var onceExecutor = new OnceExecutor(processor); return(onceExecutor); }); return(configuration); }
public StateSelector(string requestId, ExactlyOnceProcessor exactlyOnceProcessor) { this.requestId = requestId; this.exactlyOnceProcessor = exactlyOnceProcessor; }
public OnceExecutor(ExactlyOnceProcessor exactlyOnceProcessor) { this.exactlyOnceProcessor = exactlyOnceProcessor; }
public OutputInvoker(string requestId, string stateId, ExactlyOnceProcessor processor) { this.requestId = requestId; this.stateId = stateId; this.processor = processor; }
public OnceExecutorFactory(ExactlyOnceProcessor processor) { this.processor = processor; }
public OnceExecutor(ExactlyOnceProcessor processor, string requestId, string stateId) { this.processor = processor; this.requestId = requestId; this.stateId = stateId; }