Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Temporalio.Extensions.Hosting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<TemporalWorkerServiceOptions>` to use. When provided an action, the options
are available as parameters that can be configured. `TemporalWorkerServiceOptions` simply extends
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ public static ITemporalWorkerServiceOptionsBuilder AddWorkflow(
this ITemporalWorkerServiceOptionsBuilder builder, Type type) =>
builder.ConfigureOptions(options => options.AddWorkflow(type));

/// <summary>
/// Add the given Nexus service on this worker service.
/// </summary>
/// <param name="builder">Builder to use.</param>
/// <param name="serviceHandler">Service handler.</param>
/// <returns>Same builder instance.</returns>
public static ITemporalWorkerServiceOptionsBuilder AddNexusService(
this ITemporalWorkerServiceOptionsBuilder builder, object serviceHandler) =>
builder.ConfigureOptions(options => options.AddNexusService(serviceHandler));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am afraid to do this right, we'll need to support the different transient/scoped/static lifetimes and accept types and such so DI will work. I have opened #536 (not sure why I didn't have it before). Can tackle here or give us a bit to get around to it (Nexus .NET is missing a few things in its pre-release state that we are tracking).


/// <summary>
/// Get an options builder to configure worker service options.
/// </summary>
Expand Down
Loading