/// <summary> /// Performs all required initialization on the host. /// Must be called before the host is started. /// </summary> public async Task InitializeAsync() { _stopwatch.Start(); if (!_environment.IsPlaceholderModeEnabled()) { string runtimeLanguage = string.IsNullOrEmpty(_workerRuntime) ? "none" : _workerRuntime; _metricsLogger.LogEvent(string.Format(MetricEventNames.HostStartupRuntimeLanguage, runtimeLanguage)); } using (_metricsLogger.LatencyEvent(MetricEventNames.HostStartupLatency)) { PreInitialize(); HostInitializing?.Invoke(this, EventArgs.Empty); // Generate Functions IEnumerable <FunctionMetadata> functions = GetFunctionsMetadata(); // Initialize language worker function dispatcher _functionDispatcher.Initialize(_workerRuntime, functions); var directTypes = GetDirectTypes(functions); await InitializeFunctionDescriptorsAsync(functions); GenerateFunctions(directTypes); CleanupFileSystem(); } }
/// <summary> /// Performs all required initialization on the host. /// Must be called before the host is started. /// </summary> public async Task InitializeAsync() { _stopwatch.Start(); using (_metricsLogger.LatencyEvent(MetricEventNames.HostStartupLatency)) { PreInitialize(); HostInitializing?.Invoke(this, EventArgs.Empty); // Generate Functions IEnumerable <FunctionMetadata> functions = GetFunctionsMetadata(); _workerRuntime = _workerRuntime ?? Utility.GetWorkerRuntime(functions); _metricsLogger.LogEvent(string.Format(MetricEventNames.HostStartupRuntimeLanguage, _workerRuntime)); // Initialize language worker function dispatcher _functionDispatcher.Initialize(_workerRuntime, functions); var directTypes = GetDirectTypes(functions); await InitializeFunctionDescriptorsAsync(functions); GenerateFunctions(directTypes); CleanupFileSystem(); } }