lens @ 1ae70dbd9124675d4a510954619b01edd5f1f6c3

 1package worker
 2
 3type Scheduler struct {
 4	pool chan any
 5}
 6
 7func NewScheduler(count uint) *Scheduler {
 8	return &Scheduler{
 9		pool: make(chan any, count),
10	}
11}
12
13func (self *Scheduler) Take() {
14	self.pool <- nil
15}
16
17func (self *Scheduler) Return() {
18	<-self.pool
19}