func (c *ConcurrencyLimiter) Wait() (ticket int) {
	ticket = <-c.tickets
	atomic.AddInt32(&c.inProgress, 1)
	return ticket
}
Wait waits for a free ticket in the queue. Functions that call wait
must defer FreeTicket with thee ticket ID.
package limiter
import (
	"sync/atomic"
	"time"
)
type ConcurrencyLimiter struct {
	name       string
	limit      int
	tickets    chan int
	inProgress int32
}
func NewConcurrencyLimiter(name string, limit int) *ConcurrencyLimiter {
	c := &ConcurrencyLimiter{
		name:    name,
		limit:   limit,
		tickets: make(chan int, limit),
	}
	for i := 0; i < c.limit; i++ {
		c.tickets <- i
	}
	return c
}