diff --git a/src/Temporalio.Extensions.Hosting/README.md b/src/Temporalio.Extensions.Hosting/README.md index 09333055..b9da6855 100644 --- a/src/Temporalio.Extensions.Hosting/README.md +++ b/src/Temporalio.Extensions.Hosting/README.md @@ -85,6 +85,8 @@ For registering workflows on the worker, `AddWorkflow` extension method is avail collection because the construction and lifecycle of workflows is managed by Temporal. Dependency injection for workflows is intentionally not supported. +The `AddNexusService` extension method is also available. + Other worker and client options can be configured on the builder via the `ConfigureOptions` extension method. With no parameters, this returns an `OptionsBuilder` to use. When provided an action, the options are available as parameters that can be configured. `TemporalWorkerServiceOptions` simply extends diff --git a/src/Temporalio.Extensions.Hosting/TemporalWorkerServiceOptionsBuilderExtensions.cs b/src/Temporalio.Extensions.Hosting/TemporalWorkerServiceOptionsBuilderExtensions.cs index 30b40998..cf52c59f 100644 --- a/src/Temporalio.Extensions.Hosting/TemporalWorkerServiceOptionsBuilderExtensions.cs +++ b/src/Temporalio.Extensions.Hosting/TemporalWorkerServiceOptionsBuilderExtensions.cs @@ -164,6 +164,16 @@ public static ITemporalWorkerServiceOptionsBuilder AddWorkflow( this ITemporalWorkerServiceOptionsBuilder builder, Type type) => builder.ConfigureOptions(options => options.AddWorkflow(type)); + /// + /// Add the given Nexus service on this worker service. + /// + /// Builder to use. + /// Service handler. + /// Same builder instance. + public static ITemporalWorkerServiceOptionsBuilder AddNexusService( + this ITemporalWorkerServiceOptionsBuilder builder, object serviceHandler) => + builder.ConfigureOptions(options => options.AddNexusService(serviceHandler)); + /// /// Get an options builder to configure worker service options. ///