func (st *FixedFIFO) Enqueue(value interface{}) error {
	if st.IsLocked() {
		return NewQueueError(QueueErrorCodeLockedQueue, "The queue is locked")
	}
	select {
	case listener := <-st.waitForNextElementChan:
		select {
			case listener <- value:
			default:
				return st.enqueueIntoQueue(value)
		}
	default:
		return st.enqueueIntoQueue(value)
	}
	return nil
}
Enqueue enqueues an element. Returns error if queue is locked or it is at full capacity.
package goconcurrentqueue
import "context"
type FixedFIFO struct {
	queue    chan interface{}
	lockChan chan struct{}
	waitForNextElementChan chan chan interface{}
}
func NewFixedFIFO(capacity int) *FixedFIFO {
	queue := &FixedFIFO{}
	queue.initialize(capacity)
	return queue
}
func (st *FixedFIFO) initialize(capacity int) {
	st.queue = make(chan interface{}, capacity)
	st.lockChan = make(chan struct{}, 1)
	st.waitForNextElementChan = make(chan chan interface{}, WaitForNextElementChanCapacity)
}