Guest User

Untitled

a guest
Jun 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. // GateKeeper defines gate keeper for resource
  2. type GateKeeper struct {
  3. ctx context.Context
  4. cancel context.CancelFunc
  5. mux sync.Mutex
  6. queue chan PrioritizedEntity
  7. }
  8.  
  9. // New new gate keeper
  10. func New(queuedElements int) *GateKeeper {
  11. return &GateKeeper{
  12. queue: make(chan PrioritizedEntity, queuedElements),
  13. }
  14. }
Add Comment
Please, Sign In to add comment