Skip to content

Commit

Permalink
Adjust polling and batch size of test-sdk-csharp-task workers
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigueprieto committed Dec 4, 2024
1 parent 3771dc4 commit bab40a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/Worker/Workers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ static FunctionalWorkers()
_random = new Random();
}

// Polls for 5 task every 200ms
[WorkerTask("test-sdk-csharp-task", 5, "taskDomain", 200, "workerId")]
// Polls for 5 task every 100ms
[WorkerTask("test-sdk-csharp-task", 5, "taskDomain", 100, "simpleWorker")]
public static TaskResult SimpleWorker(Conductor.Client.Models.Task task)
{
return task.Completed();
}

// Polls for 12 tasks every 420ms
[WorkerTask("test-sdk-csharp-task", 12, "taskDomain", 420, "workerId")]
// Polls for 5 tasks every 420ms
[WorkerTask("test-sdk-csharp-task", 5, "taskDomain", 420, "lazyWorker")]
public TaskResult LazyWorker(Conductor.Client.Models.Task task)
{
var timeSpan = System.TimeSpan.FromMilliseconds(_random.Next(128, 2048));
var timeSpan = System.TimeSpan.FromMilliseconds(_random.Next(100, 900));
System.Threading.Tasks.Task.Delay(timeSpan).GetAwaiter().GetResult();
return task.Completed();
}
Expand Down

0 comments on commit bab40a6

Please sign in to comment.