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 Queue ¶
type Queue[T Sizeable] struct { // contains filtered or unexported fields }
type QueueHandler ¶
type QueueProvider ¶
type QueueProvider[T Sizeable] interface { GetQueue(id string) *Queue[T] RemoveQueue(id string) error Close() error }
func NewQueueProvider ¶
func NewQueueProvider[T Sizeable](size, msgType int, updater sizeUpdater, handler QueueHandler[T]) QueueProvider[T]
Click to show internal directories.
Click to hide internal directories.