Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TemporarilyRelease ¶
TemporarilyRelease temporarily releases a concurrency limiter token (if any) while calling a long-running but no-resource-using function f.
Types ¶
type ReleaseFunc ¶
type ReleaseFunc func()
A ReleaseFunc releases a concurrency limiter token.
func Acquire ¶
func Acquire(ctx context.Context) (context.Context, ReleaseFunc)
Acquire acquires a concurrency limiter token. If the context is canceled or if there is no concurrency limit associated with the context it succeeds immediately and returns a no-op release function.
The returned release function is idempotent.
Click to show internal directories.
Click to hide internal directories.