routine
import routine "ganigeorgiev.com/pocketbase/pocketbase/tools/routine"
Source: tools/routine.
Functions
FireAndForget
func FireAndForget(f func(), wg ...*sync.WaitGroup)
FireAndForget executes f() in a new go routine and auto recovers if panic.
**Note:** Use this only if you are not interested in the result of f() and don't want to block the parent go routine.
SafeWrap
func SafeWrap(f func() error) func() error
SafeWrap wraps the provided function with auto panic recover handling and returns any eventual panic as regular error.
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.