summaryrefslogtreecommitdiff
path: root/internal/workers/worker_fn.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/workers/worker_fn.go')
-rw-r--r--internal/workers/worker_fn.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/workers/worker_fn.go b/internal/workers/worker_fn.go
index c57fcfe88..5d1b5e56b 100644
--- a/internal/workers/worker_fn.go
+++ b/internal/workers/worker_fn.go
@@ -85,6 +85,11 @@ func (p *FnWorkerPool) Stop() {
p.workers = p.workers[:0]
}
+// Len returns number of currently active workers.
+func (p *FnWorkerPool) Len() int {
+ return len(p.workers)
+}
+
// FnWorker wraps a queue.SimpleQueue{} which
// it feeds from to provide it with function
// tasks to execute. It does so in a single