worker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderFuncId    = "Spear-Func-Id"
	HeaderFuncType  = "Spear-Func-Type"
	HeaderFuncAsync = "Spear-Func-Async"
)

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(lvl log.Level)

Types

type TaskMetaData

type TaskMetaData struct {
	Id    int64
	Type  task.TaskType
	Image string
	Name  string
}

type Worker

type Worker struct {
	SearchPaths []string
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(cfg *WorkerConfig) *Worker

func (*Worker) ExecuteTask

func (w *Worker) ExecuteTask(taskId int64, funcType task.TaskType, wait bool, method string, data string) (string, error)

func (*Worker) Initialize

func (w *Worker) Initialize()

func (*Worker) ListTasks

func (w *Worker) ListTasks() []string

func (*Worker) LookupTaskId

func (w *Worker) LookupTaskId(name string) (int64, error)

func (*Worker) StartServer

func (w *Worker) StartServer()

func (*Worker) Stop

func (w *Worker) Stop()

type WorkerConfig

type WorkerConfig struct {
	Addr string
	Port string

	// Search Path
	SearchPath []string

	// Debug
	Debug          bool
	LocalExecution bool

	SpearAddr string
}

func NewExecWorkerConfig

func NewExecWorkerConfig(debug bool, spearAddr string) *WorkerConfig

func NewServeWorkerConfig

func NewServeWorkerConfig(addr, port string, spath []string, debug bool, spearAddr string) *WorkerConfig

NewServeWorkerConfig creates a new WorkerConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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