Documentation
¶
Index ¶
- func AfterChan[T any](ch <-chan T, fn func(), cancelable ...bool) (cancel func())
- func AfterChanWithContext[T any](ctx context.Context, ch <-chan T, fn func(), cancelable ...bool) (cancel func())
- func AfterContext(ctx context.Context, fn func(), cancelable ...bool) (cancel func())
- func AfterTime(d time.Duration, fn func(), cancelable ...bool) (cancel func())
- func AfterTimeWithContext(ctx context.Context, d time.Duration, fn func(), cancelable ...bool) (cancel func())
- func MakeChan[T any](size ...int) (ch chan T, closech func())
- func Sleep(ctx context.Context, d time.Duration) (r bool)
- func StructChan(size ...int) (ch chan struct{}, closech func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterChan ¶
AfterChan will invoke fn when ch done, but cancel when ctx done or invoke cancel function
func AfterChanWithContext ¶
func AfterChanWithContext[T any](ctx context.Context, ch <-chan T, fn func(), cancelable ...bool) (cancel func())
AfterChanWithContext will invoke fn when ch done, but cancel when ctx done or invoke cancel function
func AfterContext ¶
AfterContext will invoke fn when ctx done, but cancel when invoke cancel function
func AfterTime ¶
AfterTime will invoke fn after d, but cancel when ctx done or invoke cancel function
func AfterTimeWithContext ¶
func AfterTimeWithContext(ctx context.Context, d time.Duration, fn func(), cancelable ...bool) (cancel func())
AfterTime will invoke fn after d, but cancel when ctx done or invoke cancel function
func MakeChan ¶
MakeChan make a channel with type T, The channel's buffer is initialized with the specified buffer capacity. If zero, or the size is omitted, the channel is unbuffered.
func StructChan ¶
func StructChan(size ...int) (ch chan struct{}, closech func())
StructChan make a unbuffered struct{} channel
Types ¶
This section is empty.