kafka

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue[T any] interface {
	// Peek allows you to read 'count' number of elements from the queue
	// without taking them out of the queue.
	Peek(ctx context.Context, count int) ([]T, error)
	// Dequeue takes out 'count' number of elements from the queue.
	Dequeue(ctx context.Context, count int) ([]T, error)
	// Enqueue add elements to the queue.
	Enqueue(ctx context.Context, items ...T) error
}

Queue specifies methods used for managing persisted queue, e.g. - in kafka.

func NewQueue

func NewQueue[T any]() Queue[T]

TODO: NewQueue manages the deleted Items in Kafka or something similar/for simple enqueue/dequeue. Below is just a mock so we can move forward prototyping the system. Finalize the API as well, e.g. perhaps we can use one (generics) Queue implemented to talk to Kafka and can take in any struct type.

Jump to

Keyboard shortcuts

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