queue

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Actions = "Action"

	DirectQueue = "DirectQueue"
	MainQueue   = "MainQueue"
	BackupQueue = "BackupQueue"
)

Variables

View Source
var ErrInvalidQueueID = errors.New("invalid queue id")

Functions

func DirectInstructionToAction

func DirectInstructionToAction(i *types.DirectInstruction) (*types.Action, error)

func PrepareDirectAction

func PrepareDirectAction(opType op.Type, opCommand op.Command, msg []byte) (*types.Action, error)

PrepareDirectAction prepares an action with direct instruction.

With type "direct" and submission tag "submit".

Types

type ActionQueues

type ActionQueues struct {
	// contains filtered or unexported fields
}

func NewActionQueues

func NewActionQueues(client *redis.Client) *ActionQueues

func (*ActionQueues) Dequeue

func (as *ActionQueues) Dequeue(ctx context.Context, queueID processorutils.QueueID) (*types.Action, error)

Dequeue dequeues action from indicated queue. If no action is available, wrapped ErrEmptyQueue is dequeued.

func (*ActionQueues) Enqueue

func (as *ActionQueues) Enqueue(ctx context.Context, action *types.Action, queueID processorutils.QueueID) error

func (*ActionQueues) QueueLength

func (as *ActionQueues) QueueLength(ctx context.Context) (int64, error)

QueueLength returns the number of elements in the main queue.

type ActionSubmissionID

type ActionSubmissionID struct {
	ActionID      common.Hash
	SubmissionTag types.SubmissionTag
}

func (*ActionSubmissionID) String

func (id *ActionSubmissionID) String() string

Jump to

Keyboard shortcuts

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