Documentation ¶
Index ¶
Constants ¶
View Source
const ( KiB = 1 << (10 * iota) MiB )
View Source
const DefaultNumWorkers = 50
View Source
const HighPriority = Priority(10)
View Source
const LowPriority = Priority(1)
View Source
const MediumPriority = Priority(5)
Variables ¶
This section is empty.
Functions ¶
func CreateQueueWorkers ¶
func CreateQueueWorkers(ctx context.Context, numWorks uint64, queue network.MessageQueue, callback func(interface{}))
CreateQueueWorkers creates queue workers to read from the queue
Types ¶
type MessagePriorityFunc ¶
MessagePriorityFunc - the callback function to derive priority of a message
type MessageQueue ¶
type MessageQueue struct {
// contains filtered or unexported fields
}
MessageQueue is the heap based priority queue implementation of the MessageQueue implementation
func NewMessageQueue ¶
func NewMessageQueue(ctx context.Context, priorityFunc MessagePriorityFunc, nm module.NetworkMetrics) *MessageQueue
func (*MessageQueue) Insert ¶
func (mq *MessageQueue) Insert(message interface{}) error
func (*MessageQueue) Len ¶
func (mq *MessageQueue) Len() int
func (*MessageQueue) Remove ¶
func (mq *MessageQueue) Remove() interface{}
type Priority ¶
type Priority int
func GetEventPriority ¶
GetEventPriority returns the priority of the flow event message. It is an average of the priority by message type and priority by message size
type QMessage ¶
type QMessage struct { Payload interface{} // the decoded message Size int // the size of the message in bytes Target network.Channel // the target channel to lookup the engine SenderID flow.Identifier // senderID for logging }
QMessage is the message that is enqueued for each incoming message
Click to show internal directories.
Click to hide internal directories.