storage

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryKey         = "goretry"
	ScheduledJobsKey = "schedule"
)

TODO(wtlangford): Check if the value of these keys are Sidekiq-compatible

View Source
const NoMessage = StorageError("no message")

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg

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

type Retries

type Retries struct {
	TotalRetryCount int64
	RetryJobs       []RetryJobStats
}

type RetryJobStats

type RetryJobStats struct {
	Class        string
	ErrorMessage string
	FailedAt     string
	JobID        string
	Queue        string
	RetryCount   int64
}

type Stats

type Stats struct {
	Processed  int64
	Failed     int64
	RetryCount int64
	Enqueued   map[string]int64
}

type StorageError

type StorageError string

func (StorageError) Error

func (e StorageError) Error() string

type Store

type Store interface {

	// General queue operations
	CreateQueue(queue string) error
	ListMessages(queue string) ([]string, error)
	AcknowledgeMessage(queue string, message string) error
	EnqueueMessage(queue string, priority float64, message string) error
	EnqueueMessageNow(queue string, message string) error
	DequeueMessage(queue string, inprogressQueue string, timeout time.Duration) (string, error)

	// Special purpose queue operations
	EnqueueScheduledMessage(priority float64, message string) error
	DequeueScheduledMessage(priority float64) (string, error)

	EnqueueRetriedMessage(priority float64, message string) error
	DequeueRetriedMessage(priority float64) (string, error)

	// Stats
	IncrementStats(metric string) error
	GetAllStats(queues []string) (*Stats, error)

	// Retries
	GetAllRetries() (*Retries, error)
}

func NewRedisStore

func NewRedisStore(namespace string, client *redis.Client) Store

Jump to

Keyboard shortcuts

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