gobi

package module
v0.0.0-...-2700947 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 8 Imported by: 0

README

gobi

Development

To develop in this repo, clone it down and then run:

git submodule init
go mod download
# pkger is used for managing bee-queue lua scripts.
go get github.com/markbates/pkger/cmd/pkger
pkger

(you'll want go 1.15+).

Documentation

Index

Constants

View Source
const BEE_QUEUE_DEFAULT_PREFIX = "bq"

Variables

This section is empty.

Functions

This section is empty.

Types

type BackoffOptions

type BackoffOptions struct {
	Strategy string `json:"strategy"`
	Delay    int64  `json:"delay"`
}

type Job

type Job interface {
	Save() (string, error)
	ID() string
	DecrementRetries()
	AddError(err error)
	GetDelay() int64
	ToData() (string, error)
	SetID(string)
}

func NewJob

func NewJob(status string, options JobOptions, data interface{}, q Queue) Job

type JobData

type JobData struct {
	Data    interface{} `json:"data"`
	Options JobOptions  `json:"options"`
	Status  string      `json:"status"`
}

type JobOptions

type JobOptions struct {
	Timestamp   int64          `json:"timestamp"`
	Delay       int64          `json:"delay"`
	Timeout     int64          `json:"timeout"`
	Retries     int64          `json:"retries"`
	Backoff     BackoffOptions `json:"backoff"`
	StackTraces []string       `json:"stacktraces"`
}

type Queue

type Queue interface {
	Name() string
	CreateJob(data interface{}, options JobOptions) Job
	ToKey(string) string
	Process(int, func(Job) (interface{}, error))

	RunScriptForName(name string, keys []string, args ...interface{}) (interface{}, error)
	NewJobFromId(string) (Job, error)
}

func NewQueue

func NewQueue(name string, client *redis.Client, options QueueOptions) Queue

type QueueEvent

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

type QueueOptions

type QueueOptions struct {
	QueuePrefix     string
	RemoveOnFailure bool
	RemoveOnSuccess bool
}

Jump to

Keyboard shortcuts

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