package
Version:
v0.0.0-...-590a924
Opens a new window with list of versions in this module.
Published: Apr 6, 2021
License: BSD-3-Clause
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
func CreateJob(pool *redis.Pool, name string, job []byte) (bool, error)
-
func EmptyQueue(pool *redis.Pool, name string) (bool, error)
-
func NewPool() *redis.Pool
-
func NewQueue(pool *redis.Pool, name string) (bool, error)
-
func RunJobWithHandler(pool *redis.Pool, name string, handler func([]byte) ([]byte, error)) ([]byte, error)
-
func WaitAndRunJob(pool *redis.Pool, name string, job []byte) (bool, error)
-
type Queue
-
type SimpleJob
CreateJob creates a new job for the queue
EmptyQueue empty the queue of jobs
NewPool Creates a new REDIS Pool
NewQueue creates a new job queue
RunJobWithHandler runs the next job of a queue
WaitAndRunJob runs the next job of a queue
type Queue struct {
Name string `json:"name"`
Offset int `json:"offset"`
Jobs [][]byte `json:"jobs"`
}
Queue represents a proxy queue for requests
GetQueue gets the status of a queue
type SimpleJob struct {
Command string `json:"command"`
Arg1 int `json:"arg1"`
Arg2 int `json:"arg2"`
}
SimpleJob serialization
Source Files
¶
Click to show internal directories.
Click to hide internal directories.