Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncQueue ¶
type AsyncQueue interface { Initialize(processFunc func(), workerCount int, bufferSize int) Push(task func()) error }
AsyncQueue is the interface responsible for asynchronous processing of functions.
type MemoryQueue ¶
type MemoryQueue struct {
// contains filtered or unexported fields
}
MemoryQueue is an implementation of the AsyncQueue interface using a channel to process functions.
func NewMemoryQueue ¶
func NewMemoryQueue(workerCount int, bufferSize int) *MemoryQueue
func (*MemoryQueue) Initialize ¶
func (mq *MemoryQueue) Initialize(workerCount int, bufferSize int)
Initialize sets up the worker nodes and the buffer size of the channel, starting internal goroutines to handle tasks from the channel.
func (*MemoryQueue) Push ¶
func (mq *MemoryQueue) Push(task func()) error
Push submits a function to the queue. Returns an error if the queue is stopped or if the queue is full.
func (*MemoryQueue) Stop ¶
func (mq *MemoryQueue) Stop()
Stop is used to terminate the internal goroutines and close the channel.
Click to show internal directories.
Click to hide internal directories.