Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue interface {
// Closed returns true if the queue is closed.
Closed() bool
// Clear releases all unread messages.
Clear()
// Close closes the queue for writing, it is still possible to read pending messages.
Close()
// Read reads an message from the queue, the message is valid until the next call to read.
// The method returns an end status when there are no more items and the queue is closed.
Read() ([]byte, bool, status.Status)
// ReadWait returns a channel which is notified when more messages are available.
// The method returns a closed channel if the queue is closed.
ReadWait() <-chan struct{}
// Write writes an message to the queue, returns false if full, or an end if closed.
Write(msg []byte) (bool, status.Status)
// WriteWait returns a channel which is notified when a message can be written.
// The method returns a closed channel if the queue is closed.
WriteWait(size int) <-chan struct{}
// Reset resets the queue, releases all unread messages, the queue can be used again.
Reset()
// Free releases the queue and its internal resources.
Free()
}
Queue is a single reader multiple writers binary message queue.
The queue can be unbounded, or can be configured with a soft max capacity. Writes mostly do not block readers.
Click to show internal directories.
Click to hide internal directories.