coroutine

package
v0.0.0-...-4fabf87 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CoroutineCancelled = fmt.Errorf("coroutine cancelled")
View Source
var CoroutineFinished = fmt.Errorf("coroutine finished")

Functions

This section is empty.

Types

type AcceptYieldFunc

type AcceptYieldFunc func(yield YieldFunc) error

type Coroutine

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

func MakeCoroutine

func MakeCoroutine(user AcceptYieldFunc) *Coroutine

func (*Coroutine) Run

func (coro *Coroutine) Run() error

nil return means the coroutine is still running. * CoroutineFinished means the coroutine has finished. * any other non-nil error is an error from the user's function

func (*Coroutine) Stop

func (coro *Coroutine) Stop()

type YieldFunc

type YieldFunc func() error

Jump to

Keyboard shortcuts

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