Beispiel #1
0
        internal Task InitializeHttpWorkerChannelAsync(int attemptCount, CancellationToken cancellationToken = default)
        {
            _httpWorkerChannel = _httpWorkerChannelFactory.Create(_scriptOptions.RootScriptPath, _metricsLogger, attemptCount);
            _httpWorkerChannel.StartWorkerProcessAsync(cancellationToken).ContinueWith(workerInitTask =>
            {
                _logger.LogDebug("Adding http worker channel. workerId:{id}", _httpWorkerChannel.Id);
                SetFunctionDispatcherStateToInitializedAndLog();
            }, TaskContinuationOptions.OnlyOnRanToCompletion);

            return(Task.CompletedTask);
        }
 internal Task InitializeHttpWorkerChannelAsync(int attemptCount, CancellationToken cancellationToken = default)
 {
     // TODO: Add process managment for http invoker
     _httpWorkerChannel = _httpWorkerChannelFactory.Create(_scriptOptions.RootScriptPath, _metricsLogger, attemptCount);
     _httpWorkerChannel.StartWorkerProcessAsync(cancellationToken).ContinueWith(workerInitTask =>
     {
         if (workerInitTask.IsCompleted)
         {
             _logger.LogDebug("Adding http worker channel. workerId:{id}", _httpWorkerChannel.Id);
             State = FunctionInvocationDispatcherState.Initialized;
         }
         else
         {
             _logger.LogWarning("Failed to start http worker process. workerId:{id}", _httpWorkerChannel.Id);
         }
     });
     return(Task.CompletedTask);
 }