queue

package
v0.0.0-...-baf8ae7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RequestLockDuration = 3 * time.Minute
View Source
const RequestLockFmt = "supervisor.requests.%s"

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	AddRegions(regions []vm.Region) error
	RemoveRegions(regions []vm.Region) error
	OnError(handler ErrorHandler)
}

type ConsumerFunc

type ConsumerFunc = func(item Item)

type ErrorHandler

type ErrorHandler = func(error)

type Item

type Item interface {
	Request() vm.Request
	Ack(ctx context.Context) error
	Nack(ctx context.Context) error
}

type Notifier

type Notifier struct {
	pubsub.Dispatcher
	// contains filtered or unexported fields
}

func NewNotifier

func NewNotifier(ctx context.Context, dispatcher pubsub.Dispatcher) *Notifier

func (*Notifier) NotifyRegion

func (n *Notifier) NotifyRegion(region vm.Region)

func (*Notifier) NotifyVM

func (n *Notifier) NotifyVM(ctx context.Context, vmId vm.Id, position int64) error

type Queue

type Queue interface {
	Add(ctx context.Context, request vm.Request) error
	CreateConsumer(ctx context.Context, fn ConsumerFunc) (Consumer, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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