q

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpointer

type Checkpointer interface {
	Set(settings *proto.QueueConfig, task *proto.Task)
}

A Checkpointer saves a checkpoint based on a task.

type QueryFactory

type QueryFactory interface {
	Query(settings *proto.QueueConfig) storage.TaskRange
}

A QueryFactory generates task queries.

type Reader

type Reader interface {
	// Ready signals whether Read *should* be invoked.
	//
	// This can be used to prevent concurrent Reads
	// if the Read operation will take a long time.
	Ready() bool

	// Read should call f on each task in the collection.
	Read(f func(task *proto.Task) error) error
}

A Reader reads tasks from a collection.

func Readers

func Readers(
	tasks *storage.TaskStore,
	settings *proto.QueueConfig,
) []Reader

Readers instantiates a list of all possible readers.

type TaskStream

type TaskStream <-chan *proto.Task

A TaskStream is an unbounded collection of tasks.

type TaskWriter

type TaskWriter interface {
	// Push should add tasks to the collection.
	//
	// isFollower indicates whether this operation is
	// being performed on a cluster follower (as opposed
	// to the leader).
	Push(tasks []*proto.Task, isFollower bool) error

	// Acknowledge should apply task acknowledgements
	// to the collection.
	Acknowledge(acks []*proto.Ack) error

	// Close should release all resources needed to
	// safely destroy the TaskWriter object.
	Close() error
}

A TaskWriter writes task-related entities to a collection.

func NewTaskWriter

func NewTaskWriter(tasks *storage.TaskStore) TaskWriter

Jump to

Keyboard shortcuts

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