memamq

package
v0.0.49-alpha.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL