Documentation
¶
Index ¶
- func Call(ctx context.Context, prefix string, fn func() error, lateFn func(error)) error
- func CallsState() string
- func GetNamedCancel(ctx context.Context, name string) (context.CancelFunc, bool)
- func Keep[T any](ps ...*T) *keeper[T]
- func MustCancelNamed(ctx context.Context, name string)
- func PipeWithContext(ctx context.Context) (*io.PipeReader, *io.PipeWriter)
- func Retry(ctx context.Context, prefix string, retryPause time.Duration, ...) error
- func RetryIncrease(ctx context.Context, retryPause time.Duration, fn func() error) error
- func Sleep(ctx context.Context, dur time.Duration) error
- func TryCancelNamed(ctx context.Context, name string) bool
- func WithCancel2(ctx1, ctx2 context.Context) (context.Context, context.CancelFunc)
- func WithNamedCancel(ctx context.Context, name string) context.Context
- type Ctx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
Allows fn to return early on ctx cancel. If fn does not return in time, lateFn will run at the end of fn (async).
func CallsState ¶
func CallsState() string
func GetNamedCancel ¶ added in v1.3.13
func MustCancelNamed ¶ added in v1.3.13
func PipeWithContext ¶ added in v1.3.13
func PipeWithContext(ctx context.Context) (*io.PipeReader, *io.PipeWriter)
func RetryIncrease ¶ added in v1.3.13
func WithCancel2 ¶ added in v1.3.8
Types ¶
Click to show internal directories.
Click to hide internal directories.