concurrency

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Await

func Await[out any](promise Promise[out]) (result out, err error)

func RecoverErr

func RecoverErr(e any) error

RecoverErr 将捕获到的 panic 转换为 error,必须在 defer 中使用

Types

type ConcurrencyResult

type ConcurrencyResult[T any] struct {
	// contains filtered or unexported fields
}

type Promise

type Promise[T any] chan ConcurrencyResult[T]

func Async

func Async[out any](fn func() out) (promise Promise[out])

Jump to

Keyboard shortcuts

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