Documentation
¶
Index ¶
- Variables
- func Go(fn func(ctx context.Context)) context.CancelFunc
- func GoDelay(dur time.Duration, fn func(ctx context.Context)) context.CancelFunc
- func GoLoop(fn func(ctx context.Context) error) context.CancelFunc
- func Map(data interface{}, fn interface{}) interface{}
- func NewGroup(opts ...GroupOption) *group
- func Stack() string
- func Timeout(dur time.Duration, fn func(ctx context.Context) error) error
- type Future
- type FutureValue
- type Group
- type GroupOption
- type IPromise
- type WaitGroup
Constants ¶
This section is empty.
Variables ¶
View Source
var Break = xerror.New("break")
View Source
var ErrTimeout = xerror.New("timeout")
Functions ¶
Types ¶
type Future ¶ added in v0.1.1
type Future interface {
Cancel()
Yield(data interface{}, fn ...interface{}) // async
Await(val FutureValue, fn interface{}) // block
}
type FutureValue ¶ added in v0.1.1
type FutureValue interface {
Err() error
String() string
Get() []reflect.Value
Value(fn interface{})
}
func Async ¶ added in v0.1.1
func Async(fn interface{}, args ...interface{}) FutureValue
func Await ¶ added in v0.1.1
func Await(val FutureValue, fn interface{}) FutureValue
type GroupOption ¶ added in v0.0.8
type GroupOption func(*group)
func WithConcurrency ¶ added in v0.0.8
func WithConcurrency(c uint32) GroupOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.