promise

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Await

func Await(p *Promise) (interface{}, error)

Types

type Interval

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

func SetInterval

func SetInterval(duration time.Duration, f func(*Interval)) *Interval

func (*Interval) Close

func (this *Interval) Close()

func (*Interval) IsClose

func (this *Interval) IsClose() bool

type Promise

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

func All

func All(promises ...*Promise) *Promise

func AllSettled

func AllSettled(promises ...*Promise) *Promise

func Async

func Async(executor func(resolve func(interface{}), reject func(interface{}))) *Promise

func Each

func Each(promises ...*Promise) *Promise

func Race

func Race(promises ...*Promise) *Promise

func Reject

func Reject(err error) *Promise

func Resolve

func Resolve(resolution interface{}) *Promise

func (*Promise) AsCallback

func (this *Promise) AsCallback(f func(interface{}, error))

func (*Promise) Await

func (this *Promise) Await() (interface{}, error)

func (*Promise) CalTime

func (this *Promise) CalTime() *Promise

func (*Promise) Catch

func (this *Promise) Catch(rejection func(err error) interface{}) *Promise

func (*Promise) Elapse

func (this *Promise) Elapse() time.Duration

func (*Promise) Reject

func (this *Promise) Reject(err interface{})

func (*Promise) Resolve

func (this *Promise) Resolve(resolution interface{})

func (*Promise) Then

func (this *Promise) Then(fulfillment func(data interface{}) interface{}) *Promise

type Timeout

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

func SetTimeout

func SetTimeout(duration time.Duration, f func(*Timeout)) *Timeout

func (*Timeout) Close

func (this *Timeout) Close()

func (*Timeout) IsClose

func (this *Timeout) IsClose() bool

Jump to

Keyboard shortcuts

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