Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coroutine ¶
type Coroutine[InT, OutT any] struct { State int32 SubState int32 In InT Out OutT Func CoroutineFunc[InT, OutT] Yielder Yielder }
func New ¶
func New[InT, OutT any](coro CoroutineFunc[InT, OutT], input InT) (c *Coroutine[InT, OutT])
func (*Coroutine[InT, OutT]) Yield ¶
func (c *Coroutine[InT, OutT]) Yield(out OutT)
Yield yields and sets the Out variable to the passed variable
func (*Coroutine[InT, OutT]) YieldNone ¶
func (c *Coroutine[InT, OutT]) YieldNone()
YieldNone yields without updating the Out variable
type CoroutineFunc ¶
type Sleeper ¶
type Sleeper struct {
// contains filtered or unexported fields
}
func NewSleeper ¶
NewSleeper returns a sleeper that is done after at least sleepDuration time has passed
Click to show internal directories.
Click to hide internal directories.