Beispiel #1
0
 public ReadWriteLock(
     IOptions <TransactionalStateOptions> options,
     TransactionQueue <TState> queue,
     BatchWorker storageWorker,
     ILogger logger,
     IActivationLifetime activationLifetime)
 {
     this.options            = options.Value;
     this.queue              = queue;
     this.storageWorker      = storageWorker;
     this.logger             = logger;
     this.activationLifetime = activationLifetime;
     this.lockWorker         = new BatchWorkerFromDelegate(LockWork, this.activationLifetime.OnDeactivating);
 }
 public TocTransactionQueue(
     TService service,
     IOptions <TransactionalStateOptions> options,
     ParticipantId resource,
     Action deactivate,
     ITransactionalStateStorage <TransactionCommitter <TService> .OperationState> storage,
     IClock clock,
     ILogger logger,
     ITimerManager timerManager,
     IActivationLifetime activationLifetime)
     : base(options, resource, deactivate, storage, clock, logger, timerManager, activationLifetime)
 {
     this.service = service;
 }
Beispiel #3
0
 public ConfirmationWorker(
     IOptions <TransactionalStateOptions> options,
     ParticipantId me,
     BatchWorker storageWorker,
     Func <StorageBatch <TState> > getStorageBatch,
     ILogger logger,
     ITimerManager timerManager,
     IActivationLifetime activationLifetime)
 {
     this.options            = options.Value;
     this.me                 = me;
     this.storageWorker      = storageWorker;
     this.getStorageBatch    = getStorageBatch;
     this.logger             = logger;
     this.timerManager       = timerManager;
     this.activationLifetime = activationLifetime;
     this.pending            = new HashSet <Guid>();
 }
Beispiel #4
0
 public TransactionQueue(
     IOptions <TransactionalStateOptions> options,
     ParticipantId resource,
     Action deactivate,
     ITransactionalStateStorage <TState> storage,
     IClock clock,
     ILogger logger,
     ITimerManager timerManager,
     IActivationLifetime activationLifetime)
 {
     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, timerManager, activationLifetime);
     this.unprocessedPreparedMessages = new Dictionary <DateTime, PreparedMessages>();
     this.commitQueue                 = new CommitQueue <TState>();
     this.readyTask                   = Task.CompletedTask;
 }