queue

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultQueue

func NewDefaultQueue[T any](name string) *defaultQueue[T]

Types

type Deliver

type Deliver[T any] struct {
	Context context.Context
	Data    T
	Time    *time.Time
	// contains filtered or unexported fields
}

func NewDeliver

func NewDeliver[T any](
	context context.Context,
	data T,
	time *time.Time,
	ackCallBack func(),
	rejectCallBack func(),
) *Deliver[T]

func (Deliver[T]) Ack

func (d Deliver[T]) Ack()

func (Deliver[T]) Reject

func (d Deliver[T]) Reject()

type QueueEngine

type QueueEngine[T any] interface {
	Name() string
	Publish(ctx context.Context, input T) error
	Subscribe(ctx context.Context, callback SubscribeFunction[T]) error
}

type SubscribeFunction

type SubscribeFunction[T any] func(d *Deliver[T])

Jump to

Keyboard shortcuts

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