Skip to content

Commit ab20380

Browse files
committed
add ability to configure MaxTasks in SelectorOptions
1 parent d4076ca commit ab20380

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Camunda.Worker/Execution/ExternalTaskSelector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private FetchAndLockRequest MakeRequestBody()
5656
{
5757
var topics = _topicsProvider.GetTopics();
5858

59-
var fetchAndLockRequest = new FetchAndLockRequest(_workerOptions.WorkerId)
59+
var fetchAndLockRequest = new FetchAndLockRequest(_workerOptions.WorkerId, _selectorOptions.MaxTasks)
6060
{
6161
UsePriority = _selectorOptions.UsePriority,
6262
AsyncResponseTimeout = _selectorOptions.AsyncResponseTimeout,

src/Camunda.Worker/Execution/SelectorOptions.cs

+7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ namespace Camunda.Worker.Execution
22
{
33
public class SelectorOptions
44
{
5+
private int _maxTasks = 1;
56
private int _asyncResponseTimeout = 10_000;
67

8+
public int MaxTasks
9+
{
10+
get => _maxTasks;
11+
set => _maxTasks = Guard.GreaterThanOrEqual(value, 1, nameof(MaxTasks));
12+
}
13+
714
public int AsyncResponseTimeout
815
{
916
get => _asyncResponseTimeout;

0 commit comments

Comments
 (0)