async

package
v0.0.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

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

Task represents a task

func NewTask

func NewTask(fn TaskFunc, data ...interface{}) *Task

NewTask creates a new task

func (*Task) Data

func (t *Task) Data() interface{}

Data returns the tasks data

func (*Task) Run

func (t *Task) Run()

Run runs the task

func (*Task) Stop

func (t *Task) Stop() error

Stop stops the task

func (*Task) Wait

func (t *Task) Wait() error

Wait waits the task to be stopped

type TaskFunc

type TaskFunc func(ctx context.Context) error

TaskFunc is the task's func

Jump to

Keyboard shortcuts

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