Documentation
¶
Index ¶
- Variables
- func End(asyncRet chan Ret)
- func EndT[T any](asyncRet chan RetT[T])
- func MakeAsyncRet() chan Ret
- func MakeAsyncRetT[T any]() chan RetT[T]
- func Return(asyncRet chan Ret, ret Ret) chan Ret
- func ReturnT[T any](asyncRet chan RetT[T], ret RetT[T]) chan RetT[T]
- func Yield(ctx context.Context, asyncRet chan Ret, ret Ret) bool
- func YieldT[T any](ctx context.Context, asyncRet chan RetT[T], ret RetT[T]) bool
- type AsyncRet
- type AsyncRetT
- type Callee
- type Caller
- type Ret
- type RetT
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAsyncRetClosed = fmt.Errorf("%w: async result closed", exception.ErrCore)
)
View Source
var (
VoidRet = MakeRet(nil, nil) // 空返回值
)
Functions ¶
Types ¶
type Callee ¶
type Callee interface { // PushCallAsync 将调用函数压入接受者的任务处理流水线,返回AsyncRet。 PushCallAsync(fun generic.FuncVar0[any, Ret], args ...any) AsyncRet // PushCallDelegateAsync 将调用委托压入接受者的任务处理流水线,返回AsyncRet。 PushCallDelegateAsync(fun generic.DelegateVar0[any, Ret], args ...any) AsyncRet // PushCallVoidAsync 将调用函数压入接受者的任务处理流水线,返回AsyncRet。 PushCallVoidAsync(fun generic.ActionVar0[any], args ...any) AsyncRet // PushCallDelegateVoidAsync 将调用委托压入接受者的任务处理流水线,返回AsyncRet。 PushCallDelegateVoidAsync(fun generic.DelegateVoidVar0[any], args ...any) AsyncRet }
Callee 异步调用接受者
type Caller ¶
type Caller interface { // CallAsync 异步调用函数,有返回值。不会阻塞当前线程,会返回AsyncRet。 // // 注意: // - 代码片段中的线程安全问题,如临界区访问、线程死锁等。 // - 调用过程中的panic信息,均会转换为error返回。 CallAsync(fun generic.FuncVar0[any, Ret], args ...any) AsyncRet // CallDelegateAsync 异步调用委托,有返回值。不会阻塞当前线程,会返回AsyncRet。 // // 注意: // - 代码片段中的线程安全问题,如临界区访问、线程死锁等。 // - 调用过程中的panic信息,均会转换为error返回。 CallDelegateAsync(fun generic.DelegateVar0[any, Ret], args ...any) AsyncRet // CallVoidAsync 异步调用函数,无返回值。在运行时中。不会阻塞当前线程,会返回AsyncRet。 // // 注意: // - 代码片段中的线程安全问题,如临界区访问、线程死锁等。 // - 调用过程中的panic信息,均会转换为error返回。 CallVoidAsync(fun generic.ActionVar0[any], args ...any) AsyncRet // CallDelegateVoidAsync 异步调用委托,无返回值。在运行时中。不会阻塞当前线程,会返回AsyncRet。 // // 注意: // - 代码片段中的线程安全问题,如临界区访问、线程死锁等。 // - 调用过程中的panic信息,均会转换为error返回。 CallDelegateVoidAsync(fun generic.DelegateVoidVar0[any], args ...any) AsyncRet }
Caller 异步调用发起者
Click to show internal directories.
Click to hide internal directories.