Documentation
¶
Index ¶
- type MemQueue
- type Memory
- type Message
- func (m *Message) GetErrorCount() int
- func (m *Message) GetID() string
- func (m *Message) GetPrefix() (prefix string)
- func (m *Message) GetStream() string
- func (m *Message) GetValues() map[string]interface{}
- func (m *Message) SetErrorCount(count int)
- func (m *Message) SetID(id string)
- func (m *Message) SetPrefix(prefix string)
- func (m *Message) SetStream(stream string)
- func (m *Message) SetValues(values map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemQueue ¶
type MemQueue struct {
// contains filtered or unexported fields
}
MemQueue is an in-process storage.Queue.
Messages live only in memory, so nothing survives a restart and nothing is shared between instances. It is the default so that a single-instance deployment needs no broker; use a Redis-backed queue for anything else.
func NewMemQueue ¶
NewMemQueue returns a queue buffering up to size messages. A size of zero or less uses the default.
type Memory ¶
type Memory struct {
PoolNum uint
// contains filtered or unexported fields
}
func (*Memory) Shutdown ¶
func (m *Memory) Shutdown()
Shutdown stops the queue and returns once the consumers have delivered what was already accepted.
It used to release Run's wait group and return, leaving every consumer goroutine blocked on a channel that was never closed - one leaked per consumer per rebuild, and the messages still buffered were lost when the process exited. Waiting is the point: a caller shuts a queue down because it is about to stop, so anything not delivered by the time this returns is not delivered at all.
type Message ¶
type Message struct {
ID string
Stream string
Values map[string]interface{}
ErrorCount int
// contains filtered or unexported fields
}