worker

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MIT Imports: 7 Imported by: 0

README

a simple worker for task server

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfirmTask

func ConfirmTask(id string, ok bool) bool

func RegisterWorker

func RegisterWorker(taskName string, f func(task *FetchedTask) bool)

func Start

func Start()

Types

type FetchedTask

type FetchedTask struct {
	Id   string
	Time int64
	Task Task
}

func FetchTask

func FetchTask(taskName string) *FetchedTask

type Task

type Task struct {
	Group string
	Name  string
	Args  map[string]interface{}
}

func (*Task) ArgsTo

func (task *Task) ArgsTo(to interface{})

Jump to

Keyboard shortcuts

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