MCPcopy
hub / github.com/go-task/task / acquireConcurrencyLimit

Method acquireConcurrencyLimit

concurrency.go:3–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1package task
2
3func (e *Executor) acquireConcurrencyLimit() func() {
4 if e.concurrencySemaphore == nil {
5 return emptyFunc
6 }
7
8 e.concurrencySemaphore <- struct{}{}
9 return func() {
10 <-e.concurrencySemaphore
11 }
12}
13
14func (e *Executor) releaseConcurrencyLimit() func() {
15 if e.concurrencySemaphore == nil {

Callers 1

RunTaskMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected