Пример #1
0
 public Partition(
     NetheriteOrchestrationService host,
     uint partitionId,
     Func <string, uint> partitionFunction,
     Func <uint> numberPartitions,
     TransportAbstraction.ISender batchSender,
     NetheriteOrchestrationServiceSettings settings,
     string storageAccountName,
     WorkItemQueue <ActivityWorkItem> activityWorkItemQueue,
     WorkItemQueue <OrchestrationWorkItem> orchestrationWorkItemQueue,
     LoadPublisher loadPublisher,
     WorkItemTraceHelper workItemTraceHelper)
 {
     this.host                       = host;
     this.PartitionId                = partitionId;
     this.PartitionFunction          = partitionFunction;
     this.NumberPartitions           = numberPartitions;
     this.BatchSender                = batchSender;
     this.Settings                   = settings;
     this.StorageAccountName         = storageAccountName;
     this.ActivityWorkItemQueue      = activityWorkItemQueue;
     this.OrchestrationWorkItemQueue = orchestrationWorkItemQueue;
     this.LoadPublisher              = loadPublisher;
     this.TraceHelper                = new PartitionTraceHelper(host.Logger, settings.LogLevelLimit, this.StorageAccountName, this.Settings.HubName, this.PartitionId);
     this.EventTraceHelper           = new EventTraceHelper(host.LoggerFactory, settings.EventLogLevelLimit, this);
     this.WorkItemTraceHelper        = workItemTraceHelper;
     this.stopwatch.Start();
 }
Пример #2
0
        public Client(
            NetheriteOrchestrationService host,
            Guid clientId,
            Guid taskHubGuid,
            TransportAbstraction.ISender batchSender,
            WorkItemTraceHelper workItemTraceHelper,
            CancellationToken shutdownToken)
        {
            this.host                = host;
            this.ClientId            = clientId;
            this.taskHubGuid         = taskHubGuid;
            this.traceHelper         = new ClientTraceHelper(host.Logger, host.Settings.LogLevelLimit, host.StorageAccountName, host.Settings.HubName, this.ClientId);
            this.workItemTraceHelper = workItemTraceHelper;
            this.account             = host.StorageAccountName;
            this.BatchSender         = batchSender;
            this.shutdownToken       = shutdownToken;
            this.ResponseTimeouts    = new BatchTimer <PendingRequest>(this.shutdownToken, this.Timeout, this.traceHelper.TraceTimerProgress);
            this.ResponseWaiters     = new ConcurrentDictionary <long, PendingRequest>();
            this.Fragments           = new Dictionary <string, MemoryStream>();
            this.ResponseTimeouts.Start("ClientTimer");
            this.workItemStopwatch = new Stopwatch();
            this.workItemStopwatch.Start();

            this.traceHelper.TraceProgress("Started");
        }