Exemplo n.º 1
0
 public TransactionQueue(
     IOptions <TransactionalStateOptions> options,
     ParticipantId resource,
     Action deactivate,
     ITransactionalStateStorage <TState> storage,
     JsonSerializerSettings serializerSettings,
     IClock clock,
     ILogger logger)
 {
     this.options                     = options.Value;
     this.resource                    = resource;
     this.deactivate                  = deactivate;
     this.storage                     = storage;
     this.Clock                       = new CausalClock(clock);
     this.logger                      = logger;
     this.storageWorker               = new BatchWorkerFromDelegate(StorageWork);
     this.RWLock                      = new ReadWriteLock <TState>(options, this, this.storageWorker, logger);
     this.confirmationWorker          = new ConfirmationWorker <TState>(options, this.resource, this.storageWorker, () => this.storageBatch, this.logger);
     this.unprocessedPreparedMessages = new Dictionary <DateTime, PreparedMessages>();
     this.commitQueue                 = new CommitQueue <TState>();
     this.readyTask                   = Task.CompletedTask;
 }