Skip to content
Open
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
13 changes: 7 additions & 6 deletions src/Temporalio/Worker/TemporalWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public TemporalWorker(IWorkerClient client, TemporalWorkerOptions options)
client.Options.Namespace,
options,
loggerFactory);
if (options.Activities.Count == 0 && options.Workflows.Count == 0)
if (options.Activities.Count == 0 && options.Workflows.Count == 0 && options.NexusServices.Count == 0)
{
throw new ArgumentException("Must have at least one workflow and/or activity");
throw new ArgumentException("Must have at least one workflow, activity, and/or Nexus service");
}

MetricMeter = MetricMeterBridge.LazyFromRuntime(BridgeWorker.Runtime);
Expand Down Expand Up @@ -110,6 +110,11 @@ public TemporalWorker(IWorkerClient client, TemporalWorkerOptions options)
DeploymentOptions: options.DeploymentOptions));
}

if (options.NexusServices.Count > 0)
{
nexusWorker = new(this);
}

disposer = new Disposer(activityWorker, BridgeWorker, workflowTracingEventListenerEnabled);
}
catch (Exception)
Expand All @@ -122,10 +127,6 @@ public TemporalWorker(IWorkerClient client, TemporalWorkerOptions options)
}
throw;
}
if (options.NexusServices.Count > 0)
{
nexusWorker = new(this);
}
}

/// <summary>
Expand Down
Loading