goworld: github.com/xiaonanln/goworld/engine/async Index | Files

package async

import "github.com/xiaonanln/goworld/engine/async"


Package Files


func AppendAsyncJob Uses

func AppendAsyncJob(group string, routine AsyncRoutine, callback AsyncCallback)

AppendAsyncJob append an async job to be executed asyncly (not in the game goroutine)

func WaitClear Uses

func WaitClear() bool

WaitClear wait for all async job workers to finish (should only be called in the game goroutine)

type AsyncCallback Uses

type AsyncCallback func(res interface{}, err error)

AsyncCallback is a function which will be called after async job is finished with result and error

type AsyncRoutine Uses

type AsyncRoutine func() (res interface{}, err error)

AsyncRoutine is a function that will be executed in the async goroutine and its result and error will be passed to AsyncCallback

Package async imports 6 packages (graph) and is imported by 2 packages. Updated 2017-11-12. Refresh now. Tools for package owners.