NewInMemoryMessageQueue creates a MessageQueue backed by a buffered channel with the given capacity.
(capacity int)
| 51 | // NewInMemoryMessageQueue creates a MessageQueue backed by a buffered channel |
| 52 | // with the given capacity. |
| 53 | func NewInMemoryMessageQueue(capacity int) MessageQueue { |
| 54 | return &inMemoryMessageQueue{ch: make(chan QueuedMessage, capacity)} |
| 55 | } |
| 56 | |
| 57 | func (q *inMemoryMessageQueue) Enqueue(_ context.Context, msg QueuedMessage) bool { |
| 58 | select { |