gojob

package module
v0.0.0-...-66a1361 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

README

gojob

Job manager in Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Go

func Go(task Task, values context.Context, onError OnError)

func Wait

func Wait()

Types

type Job

type Job struct {
}

type Manager

type Manager struct {
	sync.WaitGroup
	context.Context
	sync.Map
	// contains filtered or unexported fields
}
var (
	DefaultManager *Manager
)

func NewManager

func NewManager(maxWorkers int64) *Manager

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Go

func (m *Manager) Go(task Task, values context.Context, onError OnError)

func (*Manager) Wait

func (m *Manager) Wait()

type OnError

type OnError func(error)

type Task

type Task func(ctx context.Context, id TaskID) error

type TaskID

type TaskID = int32

Jump to

Keyboard shortcuts

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