func (t *simpleQueue) Queue(ctx context.Context, event interface{}) error {
	if atomic.CompareAndSwapUint32(&t.isInPause, StatusDelivering, StatusPaused) {
		goglog.Logger.Debugf("queue %s is requesting pause", t.GetType())
		err := t.control.RequestPause(ctx)
		if err != nil {
			goglog.Logger.Errorf("queue %s: %s", t.GetType(), err.Error())
		}
	}
	select {
	case t.queue <- event:
		return nil
	case <-ctx.Done():
		return ErrContextCancelled.New(nil)
	}
}
// Queue queues an event into the queue, blocking if necessary until cancelled. Queue is used from the output to put something into the queue.
// A call to add an event onto the queue will also pause the input.
Queue queues an event into the queue, blocking if necessary until cancelled. Queue is used from the output to put something into the queue.
A call to add an event onto the queue will also pause the input.
// Queue queues an event into the queue blocking if necessary until cancelled . Queue is used from the output to put something into the queue . // A call to add an event onto the queue will also pause the input .
func (t *simpleQueue) Queue(ctx context.Context, event interface{}) error {
	if atomic.CompareAndSwapUint32(&t.isInPause, StatusDelivering, StatusPaused) {
		goglog.Logger.Debugf("queue %s is requesting pause", t.GetType())
		err := t.control.RequestPause(ctx)
		if err != nil {
			goglog.Logger.Errorf("queue %s: %s", t.GetType(), err.Error())
		}
	}
	select {
	case t.queue <- event:
		return nil
	case <-ctx.Done():
		return ErrContextCancelled.New(nil)
	}
}
func ( t * simpleQueue ) Queue ( ctx context . Context , event interface { } ) error { if atomic . CompareAndSwapUint32 ( & t . isInPause , StatusDelivering , StatusPaused ) { goglog . Logger . Debugf ( " " , t . GetType ( ) ) err := t . control . RequestPause ( ctx ) if err != nil { goglog . Logger . Errorf ( " " , t . GetType ( ) , err . Error ( ) ) } } select { case t . queue <- event : return nil case <- ctx . Done ( ) : return ErrContextCancelled . New ( nil ) } }
Queue queues an event into the queue, blocking if necessary until cancelled.
Queue queues an event into the queue blocking if necessary until cancelled .