threading

package
v1.1.5-0...-dfb45c8 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoSafe

func GoSafe(fn func())

func RoutineId

func RoutineId() uint64

Only for debug, never use it in production

func RunSafe

func RunSafe(fn func())

Types

type RoutineGroup

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

func NewRoutineGroup

func NewRoutineGroup() *RoutineGroup

func (*RoutineGroup) Run

func (g *RoutineGroup) Run(fn func())

Don't reference the variables from outside, because outside variables can be changed by other goroutines

func (*RoutineGroup) RunSafe

func (g *RoutineGroup) RunSafe(fn func())

Don't reference the variables from outside, because outside variables can be changed by other goroutines

func (*RoutineGroup) Wait

func (g *RoutineGroup) Wait()

type TaskRunner

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

func NewTaskRunner

func NewTaskRunner(concurrency int) *TaskRunner

func (*TaskRunner) Schedule

func (rp *TaskRunner) Schedule(task func())

type WorkerGroup

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

func NewWorkerGroup

func NewWorkerGroup(job func(), workers int) WorkerGroup

func (WorkerGroup) Start

func (wg WorkerGroup) Start()

Jump to

Keyboard shortcuts

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