Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // GateKeeper defines gate keeper for resource
- type GateKeeper struct {
- ctx context.Context
- cancel context.CancelFunc
- mux sync.Mutex
- queue chan PrioritizedEntity
- }
- // New new gate keeper
- func New(queuedElements int) *GateKeeper {
- return &GateKeeper{
- queue: make(chan PrioritizedEntity, queuedElements),
- }
- }
Add Comment
Please, Sign In to add comment