Пример #1
0
 public TransactionAgent(IClock clock, ILogger <TransactionAgent> logger, ITransactionAgentStatistics statistics, ITransactionOverloadDetector overloadDetector)
 {
     this.clock            = new CausalClock(clock);
     this.logger           = logger;
     this.statistics       = statistics;
     this.overloadDetector = overloadDetector;
 }
Пример #2
0
        public TransactionalState(
            ITransactionalStateConfiguration transactionalStateConfiguration,
            IGrainActivationContext context,
            ITransactionDataCopier <TState> copier,
            ITransactionAgent transactionAgent,
            IProviderRuntime runtime,
            ILoggerFactory loggerFactory,
            JsonSerializerSettings serializerSettings,
            IClock clock
            )
        {
            this.config           = transactionalStateConfiguration;
            this.context          = context;
            this.copier           = copier;
            this.transactionAgent = transactionAgent;
            this.runtime          = runtime;
            this.loggerFactory    = loggerFactory;
            this.clock            = new CausalClock(clock);

            lockWorker         = new BatchWorkerFromDelegate(LockWork);
            storageWorker      = new BatchWorkerFromDelegate(StorageWork);
            confirmationWorker = new BatchWorkerFromDelegate(ConfirmationWork);

            this.serializerSettings = serializerSettings;
        }
Пример #3
0
        public TransactionalState(
            ITransactionalStateConfiguration transactionalStateConfiguration,
            IGrainActivationContext context,
            ITransactionDataCopier <TState> copier,
            ITransactionAgent transactionAgent,
            IProviderRuntime runtime,
            ILoggerFactory loggerFactory,
            ITypeResolver typeResolver,
            IGrainFactory grainFactory,
            IClock clock
            )
        {
            this.config           = transactionalStateConfiguration;
            this.context          = context;
            this.copier           = copier;
            this.transactionAgent = transactionAgent;
            this.runtime          = runtime;
            this.loggerFactory    = loggerFactory;
            this.clock            = new CausalClock(clock);

            lockWorker         = new BatchWorkerFromDelegate(LockWork);
            storageWorker      = new BatchWorkerFromDelegate(StorageWork);
            confirmationWorker = new BatchWorkerFromDelegate(ConfirmationWork);

            if (MetaData.SerializerSettings == null)
            {
                MetaData.SerializerSettings = TransactionParticipantExtensionExtensions.GetJsonSerializerSettings(typeResolver, grainFactory);
            }
        }
Пример #4
0
 public TransactionAgent(IClock clock, ILogger <TransactionAgent> logger)
 {
     this.clock  = new CausalClock(clock);
     this.logger = logger;
 }