common

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BACKWARDS_MODE = "backwards"
	FORWARDS_MODE  = "forwards"
)

Variables

This section is empty.

Functions

func PrefixedProcessBackwardsQueue added in v0.0.5

func PrefixedProcessBackwardsQueue(processorName, prefix string) string

PrefixedProcessBackwardsQueue returns the backwards process queue name with prefix.

func PrefixedProcessForwardsQueue added in v0.0.5

func PrefixedProcessForwardsQueue(processorName, prefix string) string

PrefixedProcessForwardsQueue returns the forwards process queue name with prefix.

func ProcessBackwardsQueue

func ProcessBackwardsQueue(processorName string) string

ProcessBackwardsQueue returns the backwards process queue name for a processor.

func ProcessForwardsQueue

func ProcessForwardsQueue(processorName string) string

ProcessForwardsQueue returns the forwards process queue name for a processor.

func ProcessQueue

func ProcessQueue(processorName string) string

ProcessQueue returns the process queue name for a processor (deprecated - use mode-specific queues).

Types

type BlockProcessor

type BlockProcessor interface {
	Processor
	ProcessNextBlock(ctx context.Context) error

	// Queue management
	GetQueues() []QueueInfo
	GetHandlers() map[string]asynq.HandlerFunc

	// Task enqueueing (for internal use)
	EnqueueTask(ctx context.Context, task *asynq.Task, opts ...asynq.Option) error

	// Processing mode configuration
	SetProcessingMode(mode string)
}

BlockProcessor handles block discovery and processing.

type Processor

type Processor interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Name() string
}

Processor defines the main interface for block processors.

type QueueInfo

type QueueInfo struct {
	Name     string
	Priority int
}

QueueInfo contains information about a processor queue.

Jump to

Keyboard shortcuts

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