asynctask

package
v0.0.0-...-8bd0779 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncTask

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

func GetNamedAsyncTask

func GetNamedAsyncTask(name string, taskChanNumber int64, goNumber int, onError func(err error)) (*AsyncTask, error)

func (*AsyncTask) Close

func (t *AsyncTask) Close()

func (*AsyncTask) Post

func (t *AsyncTask) Post(tasks ...IAsyncTask)
Example
asyncTask, err := GetNamedAsyncTask("async.task.test", 3, 3, func(err error) {
	fmt.Println("Run err", err.Error())
})
if err != nil {
	println("err", err.Error())
	return
}

asyncTask.Post(newTestTask("hello"), newTestTask("err"))
asyncTask.Close()
Output:

Run err wo qu err le

type IAsyncTask

type IAsyncTask interface {
	Run() error
}

Jump to

Keyboard shortcuts

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