Class TemporalWorkerServiceOptionsBuilderExtensions
- Namespace
- Temporalio.Extensions.Hosting
- Assembly
- Temporalio.Extensions.Hosting.dll
Extension methods for ITemporalWorkerServiceOptionsBuilder to configure worker services.
public static class TemporalWorkerServiceOptionsBuilderExtensions
- Inheritance
-
TemporalWorkerServiceOptionsBuilderExtensions
- Inherited Members
Methods
AddActivitiesInstance(ITemporalWorkerServiceOptionsBuilder, Type, object)
Register the given type's activities with an existing instance. The given instance will be used to invoke non-static activity methods.
public static ITemporalWorkerServiceOptionsBuilder AddActivitiesInstance(this ITemporalWorkerServiceOptionsBuilder builder, Type type, object instance)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeType to register activities for.
instanceobjectInstance to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
AddActivitiesInstance<T>(ITemporalWorkerServiceOptionsBuilder, T)
Register the given type's activities with an existing instance. The given instance will be used to invoke non-static activity methods.
public static ITemporalWorkerServiceOptionsBuilder AddActivitiesInstance<T>(this ITemporalWorkerServiceOptionsBuilder builder, T instance)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
instanceTInstance to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TType to register activities for.
AddScopedActivities(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type as a scoped if not already done and all activities of the given type to the worker. Basically TryAddScoped(IServiceCollection, Type) + ApplyTemporalActivities(ITemporalWorkerServiceOptionsBuilder, Type).
public static ITemporalWorkerServiceOptionsBuilder AddScopedActivities(this ITemporalWorkerServiceOptionsBuilder builder, Type type)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeType to register activities for.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
AddScopedActivities<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type as scoped if not already done and all activities of the given type to the worker. Basically TryAddScoped<TService>(IServiceCollection) + ApplyTemporalActivities<T>(ITemporalWorkerServiceOptionsBuilder).
public static ITemporalWorkerServiceOptionsBuilder AddScopedActivities<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TType to register activities for.
AddScopedNexusService(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type as scoped if not already done and all operations of the given type to the worker. Basically TryAddScoped(IServiceCollection, Type) + ApplyNexusService(ITemporalWorkerServiceOptionsBuilder, Type).
public static ITemporalWorkerServiceOptionsBuilder AddScopedNexusService(this ITemporalWorkerServiceOptionsBuilder builder, Type serviceHandlerType)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
serviceHandlerTypeTypeService handler type for which operations are registered.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Remarks
WARNING: Nexus support is experimental.
AddScopedNexusService<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type as scoped if not already done and all operations of the given type to the worker. Basically TryAddScoped<TService>(IServiceCollection) + ApplyNexusService<T>(ITemporalWorkerServiceOptionsBuilder).
public static ITemporalWorkerServiceOptionsBuilder AddScopedNexusService<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TService handler type for which operations are registered.
Remarks
WARNING: Nexus support is experimental.
AddSingletonActivities(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type as a singleton if not already done and all activities of the given type to the worker. Basically TryAddSingleton(IServiceCollection, Type) + ApplyTemporalActivities(ITemporalWorkerServiceOptionsBuilder, Type).
public static ITemporalWorkerServiceOptionsBuilder AddSingletonActivities(this ITemporalWorkerServiceOptionsBuilder builder, Type type)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeType to register activities for.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
AddSingletonActivities<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type as a singleton if not already done and all activities of the given type to the worker. Basically TryAddSingleton<TService>(IServiceCollection) + ApplyTemporalActivities<T>(ITemporalWorkerServiceOptionsBuilder).
public static ITemporalWorkerServiceOptionsBuilder AddSingletonActivities<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TType to register activities for.
AddSingletonNexusService(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type as a singleton if not already done and all operations of the given type to the worker. Basically TryAddSingleton(IServiceCollection, Type) + ApplyNexusService(ITemporalWorkerServiceOptionsBuilder, Type).
public static ITemporalWorkerServiceOptionsBuilder AddSingletonNexusService(this ITemporalWorkerServiceOptionsBuilder builder, Type serviceHandlerType)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
serviceHandlerTypeTypeService handler type for which operations are registered.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Remarks
WARNING: Nexus support is experimental.
AddSingletonNexusService<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type as a singleton if not already done and all operations of the given type to the worker. Basically TryAddSingleton<TService>(IServiceCollection) + ApplyNexusService<T>(ITemporalWorkerServiceOptionsBuilder).
public static ITemporalWorkerServiceOptionsBuilder AddSingletonNexusService<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TService handler type for which operations are registered.
Remarks
WARNING: Nexus support is experimental.
AddStaticActivities(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type's activities. The activity methods must all be static.
public static ITemporalWorkerServiceOptionsBuilder AddStaticActivities(this ITemporalWorkerServiceOptionsBuilder builder, Type type)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeType to register activities for.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
AddStaticActivities<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type's activities. The activity methods must all be static.
public static ITemporalWorkerServiceOptionsBuilder AddStaticActivities<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TType to register activities for.
AddTransientActivities(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type as transient if not already done and all activities of the given type to the worker. Basically TryAddTransient(IServiceCollection, Type) + ApplyTemporalActivities(ITemporalWorkerServiceOptionsBuilder, Type).
public static ITemporalWorkerServiceOptionsBuilder AddTransientActivities(this ITemporalWorkerServiceOptionsBuilder builder, Type type)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeType to register activities for.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
AddTransientActivities<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type as transient if not already done and all activities of the given type to the worker. Basically TryAddTransient<TService>(IServiceCollection) + ApplyTemporalActivities<T>(ITemporalWorkerServiceOptionsBuilder).
public static ITemporalWorkerServiceOptionsBuilder AddTransientActivities<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TType to register activities for.
AddTransientNexusService(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type as transient if not already done and all operations of the given type to the worker. Basically TryAddTransient(IServiceCollection, Type) + ApplyNexusService(ITemporalWorkerServiceOptionsBuilder, Type).
public static ITemporalWorkerServiceOptionsBuilder AddTransientNexusService(this ITemporalWorkerServiceOptionsBuilder builder, Type serviceHandlerType)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
serviceHandlerTypeTypeService handler type for which operations are registered.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Remarks
WARNING: Nexus support is experimental.
AddTransientNexusService<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type as transient if not already done and all operations of the given type to the worker. Basically TryAddTransient<TService>(IServiceCollection) + ApplyNexusService<T>(ITemporalWorkerServiceOptionsBuilder).
public static ITemporalWorkerServiceOptionsBuilder AddTransientNexusService<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TService handler type for which operations are registered.
Remarks
WARNING: Nexus support is experimental.
AddWorkflow(ITemporalWorkerServiceOptionsBuilder, Type)
Add the given workflow type as a workflow on this worker service.
public static ITemporalWorkerServiceOptionsBuilder AddWorkflow(this ITemporalWorkerServiceOptionsBuilder builder, Type type)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeWorkflow type.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
AddWorkflow<T>(ITemporalWorkerServiceOptionsBuilder)
Add the given workflow type as a workflow on this worker service.
public static ITemporalWorkerServiceOptionsBuilder AddWorkflow<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TWorkflow type.
ApplyNexusService(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given service handler type's operations. This uses the service provider to create the instance for non-static methods, but does not register the type/instance with the service collection.
public static ITemporalWorkerServiceOptionsBuilder ApplyNexusService(this ITemporalWorkerServiceOptionsBuilder builder, Type serviceHandlerType)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
serviceHandlerTypeTypeService handler type for which operations are registered.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Remarks
WARNING: Nexus support is experimental.
ApplyNexusService<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given service handler type's operations. This uses the service provider to create the instance for non-static methods, but does not register the type/instance with the service collection.
public static ITemporalWorkerServiceOptionsBuilder ApplyNexusService<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TService handler type for which operations are registered.
Remarks
WARNING: Nexus support is experimental.
ApplyTemporalActivities(ITemporalWorkerServiceOptionsBuilder, Type)
Register the given type's activities. This uses the service provider to create the instance for non-static methods, but does not register the type/instance with the service collection.
public static ITemporalWorkerServiceOptionsBuilder ApplyTemporalActivities(this ITemporalWorkerServiceOptionsBuilder builder, Type type)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
typeTypeType to register activities for.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
ApplyTemporalActivities<T>(ITemporalWorkerServiceOptionsBuilder)
Register the given type's activities. This uses the service provider to create the instance for non-static methods, but does not register the type/instance with the service collection.
public static ITemporalWorkerServiceOptionsBuilder ApplyTemporalActivities<T>(this ITemporalWorkerServiceOptionsBuilder builder)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
Type Parameters
TType to register activities for.
ConfigureOptions(ITemporalWorkerServiceOptionsBuilder, Action<TemporalWorkerServiceOptions>, bool)
Configure worker service options using an action.
public static ITemporalWorkerServiceOptionsBuilder ConfigureOptions(this ITemporalWorkerServiceOptionsBuilder builder, Action<TemporalWorkerServiceOptions> configure, bool disallowDuplicates = false)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
configureAction<TemporalWorkerServiceOptions>Configuration action.
disallowDuplicatesboolIf true, will fail if options already registered for this builder's task queue and build ID.
Returns
- ITemporalWorkerServiceOptionsBuilder
Same builder instance.
ConfigureOptions(ITemporalWorkerServiceOptionsBuilder, bool)
Get an options builder to configure worker service options.
public static OptionsBuilder<TemporalWorkerServiceOptions> ConfigureOptions(this ITemporalWorkerServiceOptionsBuilder builder, bool disallowDuplicates = false)
Parameters
builderITemporalWorkerServiceOptionsBuilderBuilder to use.
disallowDuplicatesboolIf true, will fail if options already registered for this builder's task queue and build ID.
Returns
- OptionsBuilder<TemporalWorkerServiceOptions>
Options builder.