File size: 573 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package ctxlock

import "time"

// Config is the configuration for an IDLocker.
type Config struct {
	// MaxHeld indicates the maximum number of locks that can be held at once,
	// per ID.
	//
	// If MaxHeld is not set, it defaults to 1.
	MaxHeld int

	// MaxWait indicates the maximum number of pending locks that can be
	// queued for a given ID.
	//
	// If MaxWait is -1, no limit is enforced.
	MaxWait int

	// Timeout indicates the maximum amount of time to wait for a lock to be
	// acquired.
	//
	// If Timeout is 0, no timeout is enforced.
	Timeout time.Duration
}