queue

package
v0.0.0-...-8506920 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key string

func GetKey

func GetKey(id string) Key

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func Instance

func Instance[T any](key Key, provider QueueProvider) Queue[T]

func (Queue[T]) Dequeue

func (q Queue[T]) Dequeue() (T, error)

func (Queue[T]) Enqueue

func (q Queue[T]) Enqueue(obj T) error

func (Queue[T]) IsEmptyErr

func (q Queue[T]) IsEmptyErr(err error) bool

type QueueProvider

type QueueProvider interface {
	Enqueue(key string, data []byte) error
	Dequeue(key string) ([]byte, error)
	IsEmptyErr(err error) bool
}

Jump to

Keyboard shortcuts

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