func (lockProp *LockProperties) Queue(request LockRequest) {
	if lockProp.MaxActive != request.MaxActive || lockProp.MaxOutStanding != request.MaxOutStanding {
		lockProp.Modified = true
	}
	if lockProp.Active < lockProp.MaxActive {
		lockProp.Active++
		request.WaitChannel <- true
	} else {
		select {
		case lockProp.WaitChannel <- request.WaitChannel:
			log.Infof("Request queued: %s\n", request.ResourceID)
		default:
			log.Infof("Max number of outstanding requests already queued for: %s\n", request.ResourceID)
			request.WaitChannel <- false
		}
	}
}
Queue - queues a lock request
package utils
import (
	"fmt"
	"revproxy/v2/pkg/common"
	"sync"
	log "github.com/sirupsen/logrus"
)
const (
	LockRequestQueueLength = 100000
)
type LockRequest struct {
	ResourceID     string
	Unlock         bool
	WaitChannel    chan bool
	MaxOutStanding int
	MaxActive      int
}
type LockProperties struct {
	MaxActive      int
	MaxOutStanding int
	Active         int
	WaitChannel    chan chan bool
	Modified       bool
}