lens @ a87e03ac1b777be4169f0d27c69e17505d96802b

 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}