Documentation ¶
Index ¶
- func Await[T any](p *Promise[T]) (any, error)
- type Interval
- type IntervalWaitFinish
- type Promise
- func All(promises ...*Promise[any]) *Promise[any]
- func AllSettled(promises ...*Promise[any]) *Promise[any]
- func Async[T any](executor func(resolve func(T), reject func(any))) *Promise[T]
- func Each(promises ...*Promise[any]) *Promise[any]
- func Race(promises ...*Promise[any]) *Promise[any]
- func Reject[T any](err error) *Promise[T]
- func Resolve[T any](resolution any) *Promise[T]
- func (this *Promise[T]) Any() *Promise[any]
- func (this *Promise[T]) AsCallback(f func(any, error))
- func (this *Promise[T]) Await() (any, error)
- func (this *Promise[T]) CalTime() *Promise[T]
- func (this *Promise[T]) Catch(rejection func(err error) any) *Promise[T]
- func (this *Promise[T]) Elapse() time.Duration
- func (this *Promise[T]) Reject(err any)
- func (this *Promise[T]) Resolve(resolution any)
- func (this *Promise[T]) Then(fulfillment func(data any) any) *Promise[T]
- type Timeout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IntervalWaitFinish ¶ added in v0.3.37
type IntervalWaitFinish struct {
// contains filtered or unexported fields
}
func SetIntervalWaitFinish ¶ added in v0.3.37
func SetIntervalWaitFinish(duration time.Duration, f func(*IntervalWaitFinish, time.Time, time.Duration)) *IntervalWaitFinish
func (*IntervalWaitFinish) Close ¶ added in v0.3.37
func (this *IntervalWaitFinish) Close()
type Promise ¶
type Promise[T any] struct { // contains filtered or unexported fields }
func (*Promise[T]) AsCallback ¶
Click to show internal directories.
Click to hide internal directories.