Skip to content

Commit

Permalink
feat(dot/sync): improve worker pool
Browse files Browse the repository at this point in the history
The main difference in the worker pool API is that SubmitBatch() does
not block until the whole batch has been processed. Instead, it returns
an ID which can be used to retrieve the current state of the batch.
In addition, Results() returns a channel over which task results are
sent as they become available.

The main improvement this brings is increased concurrency, since results
can be processed before the whole batch has been completed.

What has not changed is the overall flow of the Strategy interface;
getting a new batch of tasks with NextActions() and processing the
results with Process().

Closes #4232
  • Loading branch information
haikoschol committed Oct 15, 2024
1 parent 062b488 commit 03def6b
Show file tree
Hide file tree
Showing 6 changed files with 796 additions and 323 deletions.
2 changes: 1 addition & 1 deletion dot/sync/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func WithStrategies(currentStrategy, defaultStrategy Strategy) ServiceConfig {
func WithNetwork(net Network) ServiceConfig {
return func(svc *SyncService) {
svc.network = net
svc.workerPool = newSyncWorkerPool(net)
//svc.workerPool = newSyncWorkerPool(net)
}
}

Expand Down
Loading

0 comments on commit 03def6b

Please sign in to comment.