async

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Safe way to execute `go routine` without crashing the parent process while having a `panic`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureException added in v2.0.3

func CaptureException(c context.Context, err error)

func Execute

func Execute(fn func(), poolName ...string)

Execute provides a safe way to execute a function asynchronously without any context, recovering if they panic and provides all error stack aiming to facilitate fail causes discovery.

func ExecuteWithContext

func ExecuteWithContext(fn Task, c echo.Context, poolName ...string)

ExecuteWithContext provides a safe way to execute a function asynchronously with a context, recovering if they panic and provides all error stack aiming to facilitate fail causes discovery.

func ExecuteWithTimeout added in v2.0.3

func ExecuteWithTimeout(ctx context.Context, duration time.Duration, fn TimeoutTask, poolName ...string)

Types

type Task

type Task func(c context.Context)

type TimeoutTask added in v2.0.3

type TimeoutTask func(c context.Context) error

Jump to

Keyboard shortcuts

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