worker

package
v0.0.0-...-d13ecda Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const CRASHED = "crashed"

CRASHED crashed

View Source
const DISABLED = "disabled"

DISABLED disabled

View Source
const ENABLED = "enabled"

ENABLED enabled

View Source
const ONLINE = "online"

ONLINE online

View Source
const RUNNING = "running"

RUNNING running

View Source
const STOPPED = "stopped"

STOPPED stopped

Variables

This section is empty.

Functions

func CheckJobs

func CheckJobs(w *worker)

CheckJobs Checks redis for any jobs that need scheduled.

func CheckThreads

func CheckThreads(w *worker)

CheckThreads Checks threads in redis for any that need ran.

func Create

func Create(configFile string, redisAddr string, redisPassword string, cluster string, WorkerName string, scriptList string, host bool, hostPort string, healthPort string) (*worker, error)

Create Creates a worker

func IsEnabled

func IsEnabled(w *worker) bool

IsEnabled Returns if the worker is enabled.

Types

type EndpointMeta

type EndpointMeta struct {
	Key     string
	Stopped bool
	// contains filtered or unexported fields
}

EndpointMeta represents an endpoint

type JobMeta

type JobMeta struct {
	Key     string
	Stopped bool
	// contains filtered or unexported fields
}

JobMeta Struct that represents a job.

type SQLWrapper

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

SQLWrapper wrapper struct

func (*SQLWrapper) Close

func (sw *SQLWrapper) Close() error

Close - library implementation of sql close

func (*SQLWrapper) Exec

func (sw *SQLWrapper) Exec(query string, args ...interface{}) otto.Value

Exec - library implementation of sql queries

func (*SQLWrapper) Ping

func (sw *SQLWrapper) Ping() error

Ping - library implementation of sql pings

func (*SQLWrapper) Query

func (sw *SQLWrapper) Query(query string, args ...interface{}) []map[string]otto.Value

Query - library implementation of sql queries

type TaskInterface

type TaskInterface interface {
	// contains filtered or unexported methods
}

TaskInterface Everything we do is a task. This the interface.

type ThreadMeta

type ThreadMeta struct {
	Key     string
	Stopped bool
	// contains filtered or unexported fields
}

ThreadMeta struct that represents a thread

Jump to

Keyboard shortcuts

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