本文整理汇总了C#中JobHostConfiguration.GetExtensions方法的典型用法代码示例。如果您正苦于以下问题:C# JobHostConfiguration.GetExtensions方法的具体用法?C# JobHostConfiguration.GetExtensions怎么用?C# JobHostConfiguration.GetExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JobHostConfiguration
的用法示例。
在下文中一共展示了JobHostConfiguration.GetExtensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateAndLogHostStartedAsync
public static async Task<JobHostContext> CreateAndLogHostStartedAsync(
JobHost host,
IStorageAccountProvider storageAccountProvider,
IQueueConfiguration queueConfiguration,
ITypeLocator typeLocator,
IJobActivator activator,
INameResolver nameResolver,
IConsoleProvider consoleProvider,
JobHostConfiguration config,
CancellationToken shutdownToken,
CancellationToken cancellationToken,
IHostIdProvider hostIdProvider = null,
FunctionExecutor functionExecutor = null,
IFunctionIndexProvider functionIndexProvider = null,
IBindingProvider bindingProvider = null,
IHostInstanceLoggerProvider hostInstanceLogerProvider = null,
IFunctionInstanceLoggerProvider functionInstanceLoggerProvider = null,
IFunctionOutputLoggerProvider functionOutputLoggerProvider = null,
IBackgroundExceptionDispatcher backgroundExceptionDispatcher = null,
SingletonManager singletonManager = null)
{
if (hostIdProvider == null)
{
hostIdProvider = new DynamicHostIdProvider(storageAccountProvider, () => functionIndexProvider);
}
IExtensionTypeLocator extensionTypeLocator = new ExtensionTypeLocator(typeLocator);
if (backgroundExceptionDispatcher == null)
{
backgroundExceptionDispatcher = BackgroundExceptionDispatcher.Instance;
}
ContextAccessor<IMessageEnqueuedWatcher> messageEnqueuedWatcherAccessor = new ContextAccessor<IMessageEnqueuedWatcher>();
ContextAccessor<IBlobWrittenWatcher> blobWrittenWatcherAccessor = new ContextAccessor<IBlobWrittenWatcher>();
ISharedContextProvider sharedContextProvider = new SharedContextProvider();
// Create a wrapper TraceWriter that delegates to both the user
// TraceWriter specified on Config (if present), as well as to Console
TraceWriter trace = new ConsoleTraceWriter(config.Tracing, consoleProvider.Out);
// Register system services with the service container
config.AddService<INameResolver>(nameResolver);
ExtensionConfigContext context = new ExtensionConfigContext
{
Config = config,
Trace = trace,
Host = host
};
InvokeExtensionConfigProviders(context);
IExtensionRegistry extensions = config.GetExtensions();
ITriggerBindingProvider triggerBindingProvider = DefaultTriggerBindingProvider.Create(nameResolver,
storageAccountProvider, extensionTypeLocator, hostIdProvider, queueConfiguration, backgroundExceptionDispatcher,
messageEnqueuedWatcherAccessor, blobWrittenWatcherAccessor, sharedContextProvider, extensions, trace);
if (bindingProvider == null)
{
bindingProvider = DefaultBindingProvider.Create(nameResolver, storageAccountProvider, extensionTypeLocator, messageEnqueuedWatcherAccessor, blobWrittenWatcherAccessor, extensions);
}
DefaultLoggerProvider loggerProvider = new DefaultLoggerProvider(storageAccountProvider, trace);
if (singletonManager == null)
{
singletonManager = new SingletonManager(storageAccountProvider, backgroundExceptionDispatcher, config.Singleton, trace, config.NameResolver);
}
using (CancellationTokenSource combinedCancellationSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, shutdownToken))
{
CancellationToken combinedCancellationToken = combinedCancellationSource.Token;
await WriteSiteExtensionManifestAsync(combinedCancellationToken);
IStorageAccount dashboardAccount = await storageAccountProvider.GetDashboardAccountAsync(combinedCancellationToken);
IHostInstanceLogger hostInstanceLogger = null;
if (hostInstanceLogerProvider != null)
{
hostInstanceLogger = await hostInstanceLogerProvider.GetAsync(combinedCancellationToken);
}
else
{
hostInstanceLogger = await((IHostInstanceLoggerProvider)loggerProvider).GetAsync(combinedCancellationToken);
}
IFunctionInstanceLogger functionInstanceLogger = null;
if (functionInstanceLoggerProvider != null)
{
functionInstanceLogger = await functionInstanceLoggerProvider.GetAsync(combinedCancellationToken);
}
else
{
functionInstanceLogger = (IFunctionInstanceLogger)(await((IFunctionInstanceLoggerProvider)loggerProvider).GetAsync(combinedCancellationToken));
}
IFunctionOutputLogger functionOutputLogger = null;
if (functionOutputLoggerProvider != null)
{
functionOutputLogger = await functionOutputLoggerProvider.GetAsync(combinedCancellationToken);
}
//.........这里部分代码省略.........