Beispiel #1
0
        internal async Task InitializeJobhostLanguageWorkerChannelAsync(int attemptCount)
        {
            var rpcWorkerChannel = _rpcWorkerChannelFactory.Create(_scriptOptions.RootScriptPath, _workerRuntime, _metricsLogger, attemptCount, _workerConfigs);

            rpcWorkerChannel.SetupFunctionInvocationBuffers(_functions);
            _jobHostLanguageWorkerChannelManager.AddChannel(rpcWorkerChannel);
            await rpcWorkerChannel.StartWorkerProcessAsync();

            _logger.LogDebug("Adding jobhost language worker channel for runtime: {language}. workerId:{id}", _workerRuntime, rpcWorkerChannel.Id);
            rpcWorkerChannel.SendFunctionLoadRequests(_managedDependencyOptions.Value, _scriptOptions.FunctionTimeout);
            SetFunctionDispatcherStateToInitializedAndLog();
        }
Beispiel #2
0
        internal Task InitializeJobhostLanguageWorkerChannelAsync(int attemptCount)
        {
            var rpcWorkerChannel = _rpcWorkerChannelFactory.Create(_scriptOptions.RootScriptPath, _workerRuntime, _metricsLogger, attemptCount, _workerConfigs);

            rpcWorkerChannel.SetupFunctionInvocationBuffers(_functions);
            _jobHostLanguageWorkerChannelManager.AddChannel(rpcWorkerChannel);
            rpcWorkerChannel.StartWorkerProcessAsync().ContinueWith(workerInitTask =>
            {
                _logger.LogDebug("Adding jobhost language worker channel for runtime: {language}. workerId:{id}", _workerRuntime, rpcWorkerChannel.Id);
                rpcWorkerChannel.SendFunctionLoadRequests(_managedDependencyOptions.Value);
                SetFunctionDispatcherStateToInitializedAndLog();
            }, TaskContinuationOptions.OnlyOnRanToCompletion);
            return(Task.CompletedTask);
        }
Beispiel #3
0
        internal Task InitializeJobhostLanguageWorkerChannelAsync(int attemptCount)
        {
            var rpcWorkerChannel = _rpcWorkerChannelFactory.Create(_scriptOptions.RootScriptPath, _workerRuntime, _metricsLogger, attemptCount);

            rpcWorkerChannel.SetupFunctionInvocationBuffers(_functions);
            _jobHostLanguageWorkerChannelManager.AddChannel(rpcWorkerChannel);
            rpcWorkerChannel.StartWorkerProcessAsync().ContinueWith(workerInitTask =>
            {
                if (workerInitTask.IsCompleted)
                {
                    _logger.LogDebug("Adding jobhost language worker channel for runtime: {language}. workerId:{id}", _workerRuntime, rpcWorkerChannel.Id);
                    rpcWorkerChannel.SendFunctionLoadRequests(_managedDependencyOptions.Value);
                    State = FunctionInvocationDispatcherState.Initialized;
                }
                else
                {
                    _logger.LogWarning("Failed to start language worker process for runtime: {language}. workerId:{id}", _workerRuntime, rpcWorkerChannel.Id);
                }
            });
            return(Task.CompletedTask);
        }