goku

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

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

Go to latest
Published: Oct 22, 2022 License: MIT Imports: 10 Imported by: 0

README

goku

Golang Queue

Documentation

Index

Constants

View Source
const (
	POLLFREQ   = 10
	NUMWORKERS = 3
)

Variables

View Source
var (
	STRING = payloadType{"string"}
	INT    = payloadType{"int"}
)

Functions

This section is empty.

Types

type Application

type Application interface {
	AddJob(j ...Job) error
	Enqueue(q string, p Payload) error
	GetAppName() string
	Start() error
}

func NewRedis

func NewRedis(name string, connInfo RedisConn, options interface{}, j ...Job) (Application, error)

type Job

type Job interface {
	Perform(data []byte) error
	GetQName() string
}

func NewJob

func NewJob(q string, fn interface{}, pt payloadType) (Job, error)

type Options

type Options struct {
	PollFreq   int
	NumWorkers int
}

type Payload

type Payload struct {
	PayloadType payloadType `json:"payloadType"`
	Data        []byte      `json:"data"`
}

type Redis

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

func (*Redis) AddJob

func (r *Redis) AddJob(jobs ...Job) error

func (*Redis) Enqueue

func (r *Redis) Enqueue(q string, p Payload) error

func (*Redis) GetAppName

func (r *Redis) GetAppName() string

func (*Redis) Start

func (r *Redis) Start() error

type RedisConn

type RedisConn gr.UniversalOptions

RedisConn . . . redis connection info

Jump to

Keyboard shortcuts

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