tasker

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tasker

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

Tasker is a small helper utility that makes it easy to move tasks to a different goroutine. This is useful when some work must be executed from a specific goroutine / OS thread.

func New

func New() *Tasker

New prepares a new Tasker.

func (*Tasker) Do

func (t *Tasker) Do(f func())

Do runs the given function in the goroutine where ExecuteTasks is called. Do blocks until the given function has completed.

func (*Tasker) ExecuteTasks

func (t *Tasker) ExecuteTasks()

ExecuteTasks executes any pending tasks, then returns.

Jump to

Keyboard shortcuts

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