multiqueue

package
v0.5.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrThreadNotExists = errors.New("multiQueue: thread not exists")
	ErrClosed          = errors.New("multiQueue: closed")
)

Functions

This section is empty.

Types

type HandleFunc

type HandleFunc[T any] func(msg T)

type MultiQueue

type MultiQueue[T Sizeable] interface {
	Add(ctx context.Context, threadId string, msg T) (err error)
	CloseThread(threadId string) (err error)
	ThreadIds() []string
	Close() (err error)
}

func New

func New[T Sizeable](h HandleFunc[T], updater sizeUpdater, msgType int, maxThreadSize int) MultiQueue[T]

type Sizeable added in v0.5.0

type Sizeable interface {
	MsgSize() uint64
}

Jump to

Keyboard shortcuts

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