Skip to content

Commit d45dd7a

Browse files
committed
Explicitly disallowing Nexus custom slot supplier
1 parent 04eeddd commit d45dd7a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Temporalio/Bridge/OptionsExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@ private static Interop.TemporalCoreTunerHolder ToInteropTuner(
661661
}
662662
}
663663

664+
// TODO: remove when implemented: https://github.com/temporalio/sdk-dotnet/issues/528
665+
if (tuner.NexusTaskSlotSupplier is Temporalio.Worker.Tuning.CustomSlotSupplier)
666+
{
667+
throw new ArgumentException("Custom Nexus task slot suppliers are unsupported");
668+
}
669+
664670
return new()
665671
{
666672
workflow_slot_supplier =

tests/Temporalio.Tests/Worker/WorkerTuningTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ public async Task CanRunWith_CustomSlotSupplier()
215215
Client,
216216
new TemporalWorkerOptions($"tq-{Guid.NewGuid()}")
217217
{
218-
Tuner = new WorkerTuner(mySlotSupplier, mySlotSupplier, mySlotSupplier, mySlotSupplier),
218+
// TODO: change Nexus to custom slot supplier after it's implemented: https://github.com/temporalio/sdk-dotnet/issues/528
219+
Tuner = new WorkerTuner(mySlotSupplier, mySlotSupplier, mySlotSupplier, new FixedSizeSlotSupplier(10)),
219220
}.AddWorkflow<SimpleWorkflow>().AddActivity(SimpleWorkflow.SomeActivity));
220221
await worker.ExecuteAsync(async () =>
221222
{
@@ -268,7 +269,8 @@ public async Task CanRunWith_ThrowingSlotSupplier()
268269
Client,
269270
new TemporalWorkerOptions($"tq-{Guid.NewGuid()}")
270271
{
271-
Tuner = new WorkerTuner(mySlotSupplier, mySlotSupplier, mySlotSupplier, mySlotSupplier),
272+
// TODO: change Nexus to custom slot supplier after it's implemented: https://github.com/temporalio/sdk-dotnet/issues/528
273+
Tuner = new WorkerTuner(mySlotSupplier, mySlotSupplier, mySlotSupplier, new FixedSizeSlotSupplier(10)),
272274
}.AddWorkflow<OneTaskWf>());
273275
await worker.ExecuteAsync(async () =>
274276
{
@@ -309,7 +311,8 @@ public async Task CanRunWith_BlockingSlotSupplier()
309311
Client,
310312
new TemporalWorkerOptions($"tq-{Guid.NewGuid()}")
311313
{
312-
Tuner = new WorkerTuner(mySlotSupplier, mySlotSupplier, mySlotSupplier, mySlotSupplier),
314+
// TODO: change Nexus to custom slot supplier after it's implemented: https://github.com/temporalio/sdk-dotnet/issues/528
315+
Tuner = new WorkerTuner(mySlotSupplier, mySlotSupplier, mySlotSupplier, new FixedSizeSlotSupplier(10)),
313316
}.AddWorkflow<OneTaskWf>());
314317
await worker.ExecuteAsync(async () =>
315318
{

0 commit comments

Comments
 (0)