Exemple #1
0
        public OrchestrationSession(
            string storageAccountName,
            string taskHubName,
            OrchestrationInstance orchestrationInstance,
            ControlQueue controlQueue,
            IList <MessageData> initialMessageBatch,
            OrchestrationRuntimeState runtimeState,
            string eTag,
            TimeSpan idleTimeout,
            Guid traceActivityId)
            : base(storageAccountName, taskHubName, orchestrationInstance, traceActivityId)
        {
            this.idleTimeout         = idleTimeout;
            this.ControlQueue        = controlQueue ?? throw new ArgumentNullException(nameof(controlQueue));
            this.CurrentMessageBatch = initialMessageBatch ?? throw new ArgumentNullException(nameof(initialMessageBatch));
            this.RuntimeState        = runtimeState ?? throw new ArgumentNullException(nameof(runtimeState));
            this.ETag = eTag;

            this.messagesAvailableEvent = new AsyncAutoResetEvent(signaled: false);
            this.sessionReleasedEvent   = new AsyncManualResetEvent();
            this.nextMessageBatch       = new MessageCollection();
        }
        public OrchestrationSession(
            AzureStorageOrchestrationServiceSettings settings,
            string storageAccountName,
            OrchestrationInstance orchestrationInstance,
            ControlQueue controlQueue,
            List <MessageData> initialMessageBatch,
            OrchestrationRuntimeState runtimeState,
            string eTag,
            DateTime lastCheckpointTime,
            TimeSpan idleTimeout,
            Guid traceActivityId)
            : base(settings, storageAccountName, orchestrationInstance, traceActivityId)
        {
            this.idleTimeout         = idleTimeout;
            this.ControlQueue        = controlQueue ?? throw new ArgumentNullException(nameof(controlQueue));
            this.CurrentMessageBatch = initialMessageBatch ?? throw new ArgumentNullException(nameof(initialMessageBatch));
            this.RuntimeState        = runtimeState ?? throw new ArgumentNullException(nameof(runtimeState));
            this.ETag = eTag;
            this.LastCheckpointTime = lastCheckpointTime;

            this.messagesAvailableEvent = new AsyncAutoResetEvent(signaled: false);
            this.nextMessageBatch       = new MessageCollection();
        }