MCPcopy
hub / github.com/cortexlabs/cortex / tryAcquire

Function tryAcquire

pkg/proxy/breaker_test.go:339–345  ·  view source on GitHub ↗
(sem *semaphore, gotChan chan struct{})

Source from the content-addressed store, hash-verified

337}
338
339func tryAcquire(sem *semaphore, gotChan chan struct{}) {
340 go func() {
341 // blocking until someone puts the token into the semaphore
342 sem.acquire(context.Background())
343 gotChan <- struct{}{}
344 }()
345}
346
347// requestor is a set of test helpers around breaker testing.
348type requestor struct {

Calls 1

acquireMethod · 0.80

Tested by

no test coverage detected