Skip to content

Commit 398f826

Browse files
authored
Rename namespace from outofProc to workers (#5140)
1 parent a26a1f6 commit 398f826

File tree

164 files changed

+1298
-1325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+1298
-1325
lines changed

src/WebJobs.Script.WebHost/DependencyInjection/DependencyValidator/DependencyValidator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
using Microsoft.Azure.WebJobs.Script.Diagnostics;
99
using Microsoft.Azure.WebJobs.Script.Eventing;
1010
using Microsoft.Azure.WebJobs.Script.FileProvisioning;
11-
using Microsoft.Azure.WebJobs.Script.Rpc;
1211
using Microsoft.Azure.WebJobs.Script.Scale;
1312
using Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics;
13+
using Microsoft.Azure.WebJobs.Script.Workers;
1414
using Microsoft.Extensions.DependencyInjection;
1515
using Microsoft.Extensions.Hosting;
1616
using Microsoft.Extensions.Logging;
@@ -43,8 +43,8 @@ private static ExpectedDependencyBuilder CreateExpectedDependencies()
4343
.Expect<JobHostService>("Microsoft.Azure.WebJobs.Hosting.OptionsLoggingService")
4444
.Expect<PrimaryHostCoordinator>()
4545
.Expect<FileMonitoringService>()
46-
.Expect<LanguageWorkerConsoleLogService>()
47-
.Expect<FunctionDispatcherShutdownManager>()
46+
.Expect<WorkerConsoleLogService>()
47+
.Expect<FunctionInvocationDispatcherShutdownManager>()
4848
.Optional<FunctionsScaleMonitorService>()
4949
.Optional<FuncAppFileProvisioningService>() // Used by powershell.
5050
.Optional<JobHostService>() // Missing when host is offline.

src/WebJobs.Script.WebHost/Diagnostics/SystemLoggerProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System;
55
using Microsoft.Azure.WebJobs.Logging;
66
using Microsoft.Azure.WebJobs.Script.Eventing;
7-
using Microsoft.Azure.WebJobs.Script.OutOfProc;
7+
using Microsoft.Azure.WebJobs.Script.Workers;
88
using Microsoft.Extensions.Logging;
99
using Microsoft.Extensions.Logging.Abstractions;
1010
using Microsoft.Extensions.Options;
@@ -46,7 +46,7 @@ public ILogger CreateLogger(string categoryName)
4646

4747
private bool IsUserLogCategory(string categoryName)
4848
{
49-
return LogCategories.IsFunctionUserCategory(categoryName) || categoryName.Equals(OutOfProcConstants.FunctionConsoleLogCategoryName, StringComparison.OrdinalIgnoreCase);
49+
return LogCategories.IsFunctionUserCategory(categoryName) || categoryName.Equals(WorkerConstants.FunctionConsoleLogCategoryName, StringComparison.OrdinalIgnoreCase);
5050
}
5151

5252
public void Dispose()

src/WebJobs.Script.WebHost/Management/WebFunctionsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
using Microsoft.AspNetCore.Http;
1111
using Microsoft.Azure.WebJobs.Script.Description;
1212
using Microsoft.Azure.WebJobs.Script.Management.Models;
13-
using Microsoft.Azure.WebJobs.Script.Rpc;
1413
using Microsoft.Azure.WebJobs.Script.WebHost.Extensions;
14+
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
1515
using Microsoft.Extensions.Logging;
1616
using Microsoft.Extensions.Options;
1717
using Newtonsoft.Json;
@@ -24,7 +24,7 @@ public class WebFunctionsManager : IWebFunctionsManager
2424
private readonly IOptionsMonitor<ScriptApplicationHostOptions> _applicationHostOptions;
2525
private readonly ILogger _logger;
2626
private readonly HttpClient _client;
27-
private readonly IEnumerable<WorkerConfig> _workerConfigs;
27+
private readonly IEnumerable<RpcWorkerConfig> _workerConfigs;
2828
private readonly ISecretManagerProvider _secretManagerProvider;
2929
private readonly IFunctionsSyncManager _functionsSyncManager;
3030
private readonly HostNameProvider _hostNameProvider;

src/WebJobs.Script.WebHost/Standby/StandbyManager.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
using Microsoft.AspNetCore.Hosting;
1010
using Microsoft.Azure.WebJobs.Script.Description;
1111
using Microsoft.Azure.WebJobs.Script.Diagnostics;
12-
using Microsoft.Azure.WebJobs.Script.Rpc;
1312
using Microsoft.Azure.WebJobs.Script.WebHost.Properties;
13+
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
1414
using Microsoft.Extensions.Configuration;
1515
using Microsoft.Extensions.FileProviders;
1616
using Microsoft.Extensions.Logging;
@@ -29,7 +29,7 @@ public class StandbyManager : IStandbyManager, IDisposable
2929
private readonly Lazy<Task> _specializationTask;
3030
private readonly IScriptWebHostEnvironment _webHostEnvironment;
3131
private readonly IEnvironment _environment;
32-
private readonly IWebHostLanguageWorkerChannelManager _languageWorkerChannelManager;
32+
private readonly IWebHostRpcWorkerChannelManager _rpcWorkerChannelManager;
3333
private readonly IConfigurationRoot _configuration;
3434
private readonly ILogger _logger;
3535
private readonly IMetricsLogger _metricsLogger;
@@ -43,13 +43,13 @@ public class StandbyManager : IStandbyManager, IDisposable
4343
private static IChangeToken _standbyChangeToken = new CancellationChangeToken(_standbyCancellationTokenSource.Token);
4444
private static SemaphoreSlim _semaphore = new SemaphoreSlim(1, 1);
4545

46-
public StandbyManager(IScriptHostManager scriptHostManager, IWebHostLanguageWorkerChannelManager languageWorkerChannelManager, IConfiguration configuration, IScriptWebHostEnvironment webHostEnvironment,
46+
public StandbyManager(IScriptHostManager scriptHostManager, IWebHostRpcWorkerChannelManager rpcWorkerChannelManager, IConfiguration configuration, IScriptWebHostEnvironment webHostEnvironment,
4747
IEnvironment environment, IOptionsMonitor<ScriptApplicationHostOptions> options, ILogger<StandbyManager> logger, HostNameProvider hostNameProvider, IApplicationLifetime applicationLifetime, IMetricsLogger metricsLogger)
48-
: this(scriptHostManager, languageWorkerChannelManager, configuration, webHostEnvironment, environment, options, logger, hostNameProvider, applicationLifetime, TimeSpan.FromMilliseconds(500), metricsLogger)
48+
: this(scriptHostManager, rpcWorkerChannelManager, configuration, webHostEnvironment, environment, options, logger, hostNameProvider, applicationLifetime, TimeSpan.FromMilliseconds(500), metricsLogger)
4949
{
5050
}
5151

52-
public StandbyManager(IScriptHostManager scriptHostManager, IWebHostLanguageWorkerChannelManager languageWorkerChannelManager, IConfiguration configuration, IScriptWebHostEnvironment webHostEnvironment,
52+
public StandbyManager(IScriptHostManager scriptHostManager, IWebHostRpcWorkerChannelManager rpcWorkerChannelManager, IConfiguration configuration, IScriptWebHostEnvironment webHostEnvironment,
5353
IEnvironment environment, IOptionsMonitor<ScriptApplicationHostOptions> options, ILogger<StandbyManager> logger, HostNameProvider hostNameProvider, IApplicationLifetime applicationLifetime, TimeSpan specializationTimerInterval, IMetricsLogger metricsLogger)
5454
{
5555
_scriptHostManager = scriptHostManager ?? throw new ArgumentNullException(nameof(scriptHostManager));
@@ -60,7 +60,7 @@ public StandbyManager(IScriptHostManager scriptHostManager, IWebHostLanguageWork
6060
_webHostEnvironment = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment));
6161
_environment = environment ?? throw new ArgumentNullException(nameof(environment));
6262
_configuration = configuration as IConfigurationRoot ?? throw new ArgumentNullException(nameof(configuration));
63-
_languageWorkerChannelManager = languageWorkerChannelManager ?? throw new ArgumentNullException(nameof(languageWorkerChannelManager));
63+
_rpcWorkerChannelManager = rpcWorkerChannelManager ?? throw new ArgumentNullException(nameof(rpcWorkerChannelManager));
6464
_hostNameProvider = hostNameProvider ?? throw new ArgumentNullException(nameof(hostNameProvider));
6565
_changeTokenCallbackSubscription = ChangeToken.RegisterChangeCallback(_ => _logger.LogDebug($"{nameof(StandbyManager)}.{nameof(ChangeToken)} callback has fired."), null);
6666
_specializationTimerInterval = specializationTimerInterval;
@@ -109,7 +109,7 @@ public async Task SpecializeHostCoreAsync()
109109

110110
using (_metricsLogger.LatencyEvent(MetricEventNames.SpecializationLanguageWorkerChannelManagerSpecialize))
111111
{
112-
await _languageWorkerChannelManager.SpecializeAsync();
112+
await _rpcWorkerChannelManager.SpecializeAsync();
113113
}
114114

115115
NotifyChange();

src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Microsoft.Azure.WebJobs.Script.Configuration;
1010
using Microsoft.Azure.WebJobs.Script.Diagnostics;
1111
using Microsoft.Azure.WebJobs.Script.Middleware;
12-
using Microsoft.Azure.WebJobs.Script.Rpc;
1312
using Microsoft.Azure.WebJobs.Script.WebHost.Configuration;
1413
using Microsoft.Azure.WebJobs.Script.WebHost.ContainerManagement;
1514
using Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection;
@@ -20,6 +19,7 @@
2019
using Microsoft.Azure.WebJobs.Script.WebHost.Security.Authorization;
2120
using Microsoft.Azure.WebJobs.Script.WebHost.Security.Authorization.Policies;
2221
using Microsoft.Azure.WebJobs.Script.WebHost.Standby;
22+
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
2323
using Microsoft.Extensions.Configuration;
2424
using Microsoft.Extensions.DependencyInjection;
2525
using Microsoft.Extensions.DependencyInjection.Extensions;

src/WebJobs.Script/Binding/Http/HttpBinding.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using Microsoft.AspNetCore.Mvc.WebApiCompatShim;
1818
using Microsoft.Azure.WebJobs.Script.Config;
1919
using Microsoft.Azure.WebJobs.Script.Description;
20-
using Microsoft.Azure.WebJobs.Script.Rpc;
20+
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
2121
using Newtonsoft.Json;
2222
using Newtonsoft.Json.Linq;
2323

@@ -115,12 +115,12 @@ internal static void ParseResponseObject(IDictionary<string, object> responseObj
115115
// Sniff the object to see if it looks like a response object
116116
// by convention
117117
object bodyValue = null;
118-
if (responseObject.TryGetValue(LanguageWorkerConstants.RpcHttpBody, out bodyValue, ignoreCase: true))
118+
if (responseObject.TryGetValue(RpcWorkerConstants.RpcHttpBody, out bodyValue, ignoreCase: true))
119119
{
120120
// the response content becomes the specified body value
121121
content = bodyValue;
122122

123-
if (responseObject.TryGetValue(LanguageWorkerConstants.RpcHttpHeaders, out IDictionary<string, object> headersValue, ignoreCase: true))
123+
if (responseObject.TryGetValue(RpcWorkerConstants.RpcHttpHeaders, out IDictionary<string, object> headersValue, ignoreCase: true))
124124
{
125125
headers = headersValue;
126126
}
@@ -130,12 +130,12 @@ internal static void ParseResponseObject(IDictionary<string, object> responseObj
130130
statusCode = responseStatusCode.Value;
131131
}
132132

133-
if (responseObject.TryGetValue<bool>(LanguageWorkerConstants.RpcHttpEnableContentNegotiation, out bool enableContentNegotiationValue, ignoreCase: true))
133+
if (responseObject.TryGetValue<bool>(RpcWorkerConstants.RpcHttpEnableContentNegotiation, out bool enableContentNegotiationValue, ignoreCase: true))
134134
{
135135
enableContentNegotiation = enableContentNegotiationValue;
136136
}
137137

138-
if (responseObject.TryGetValue(LanguageWorkerConstants.RpcHttpCookies, out List<Tuple<string, string, CookieOptions>> cookiesValue, ignoreCase: true))
138+
if (responseObject.TryGetValue(RpcWorkerConstants.RpcHttpCookies, out List<Tuple<string, string, CookieOptions>> cookiesValue, ignoreCase: true))
139139
{
140140
cookies = cookiesValue;
141141
}
@@ -146,8 +146,8 @@ internal static bool TryParseStatusCode(IDictionary<string, object> responseObje
146146
{
147147
statusCode = StatusCodes.Status200OK;
148148

149-
if (!responseObject.TryGetValue(LanguageWorkerConstants.RpcHttpStatusCode, out object statusValue, ignoreCase: true) &&
150-
!responseObject.TryGetValue(LanguageWorkerConstants.RpcHttpStatus, out statusValue, ignoreCase: true))
149+
if (!responseObject.TryGetValue(RpcWorkerConstants.RpcHttpStatusCode, out object statusValue, ignoreCase: true) &&
150+
!responseObject.TryGetValue(RpcWorkerConstants.RpcHttpStatus, out statusValue, ignoreCase: true))
151151
{
152152
return false;
153153
}

src/WebJobs.Script/Config/HostJsonFileConfigurationSource.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Microsoft.Azure.WebJobs.Logging;
1010
using Microsoft.Azure.WebJobs.Script.Diagnostics;
1111
using Microsoft.Azure.WebJobs.Script.Diagnostics.Extensions;
12-
using Microsoft.Azure.WebJobs.Script.Rpc;
12+
using Microsoft.Azure.WebJobs.Script.Workers.Rpc;
1313
using Microsoft.Extensions.Configuration;
1414
using Microsoft.Extensions.Logging;
1515
using Newtonsoft.Json;
@@ -205,7 +205,7 @@ internal JObject LoadHostConfig(string configFilePath)
205205
private JObject GetDefaultHostConfigObject()
206206
{
207207
var hostJsonJObj = JObject.Parse("{'version': '2.0'}");
208-
if (string.Equals(_configurationSource.Environment.GetEnvironmentVariable(LanguageWorkerConstants.FunctionWorkerRuntimeSettingName), "powershell", StringComparison.InvariantCultureIgnoreCase)
208+
if (string.Equals(_configurationSource.Environment.GetEnvironmentVariable(RpcWorkerConstants.FunctionWorkerRuntimeSettingName), "powershell", StringComparison.InvariantCultureIgnoreCase)
209209
&& !_configurationSource.Environment.IsFileSystemReadOnly())
210210
{
211211
hostJsonJObj.Add("managedDependency", JToken.Parse("{'Enabled': true}"));

src/WebJobs.Script/Config/ScriptHostOptionsSetup.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using System;
5-
using System.Globalization;
65
using Microsoft.Extensions.Configuration;
76
using Microsoft.Extensions.Options;
8-
using static Microsoft.Azure.WebJobs.Script.Rpc.LanguageWorkerConstants;
97

108
namespace Microsoft.Azure.WebJobs.Script.Configuration
119
{

src/WebJobs.Script/Description/OutOfProc/Http/HttpFunctionDescriptorProvider.cs renamed to src/WebJobs.Script/Description/Workers/Http/HttpFunctionDescriptorProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
using System.Collections.Generic;
55
using Microsoft.Azure.WebJobs.Script.Extensibility;
6-
using Microsoft.Azure.WebJobs.Script.Rpc;
6+
using Microsoft.Azure.WebJobs.Script.Workers;
77
using Microsoft.Extensions.Logging;
88

99
namespace Microsoft.Azure.WebJobs.Script.Description
1010
{
11-
internal class HttpFunctionDescriptorProvider : OutOfProcDescriptorProvider
11+
internal class HttpFunctionDescriptorProvider : WorkerFunctionDescriptorProvider
1212
{
1313
public HttpFunctionDescriptorProvider(ScriptHost host, ScriptJobHostOptions config, ICollection<IScriptBindingProvider> bindingProviders,
14-
IFunctionDispatcher dispatcher, ILoggerFactory loggerFactory)
14+
IFunctionInvocationDispatcher dispatcher, ILoggerFactory loggerFactory)
1515
: base(host, config, bindingProviders, dispatcher, loggerFactory)
1616
{
1717
}

src/WebJobs.Script/Description/OutOfProc/Rpc/RpcFunctionDescriptorProvider.cs renamed to src/WebJobs.Script/Description/Workers/Rpc/RpcFunctionDescriptorProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
using System.Collections.Generic;
66
using System.Threading.Tasks;
77
using Microsoft.Azure.WebJobs.Script.Extensibility;
8-
using Microsoft.Azure.WebJobs.Script.Rpc;
8+
using Microsoft.Azure.WebJobs.Script.Workers;
99
using Microsoft.Extensions.Logging;
1010

1111
namespace Microsoft.Azure.WebJobs.Script.Description
1212
{
13-
internal class RpcFunctionDescriptorProvider : OutOfProcDescriptorProvider
13+
internal class RpcFunctionDescriptorProvider : WorkerFunctionDescriptorProvider
1414
{
15-
private string _workerRuntime;
15+
private readonly string _workerRuntime;
1616

1717
public RpcFunctionDescriptorProvider(ScriptHost host, string workerRuntime, ScriptJobHostOptions config, ICollection<IScriptBindingProvider> bindingProviders,
18-
IFunctionDispatcher dispatcher, ILoggerFactory loggerFactory)
18+
IFunctionInvocationDispatcher dispatcher, ILoggerFactory loggerFactory)
1919
: base(host, config, bindingProviders, dispatcher, loggerFactory)
2020
{
2121
_workerRuntime = workerRuntime;

0 commit comments

Comments
 (0)