-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Fallback is a function that is expected to execute the functions in order until one of them succeeds (does not return an error). If all functions fail, it returns the error from the last function.
err := async.Fallback(
func() error {
// do something
return errors.New("first error")
},
func() error {
// do something else
return nil // success
},
func() error {
// this function will not be executed because the previous one succeeded
return nil
},
)
// err is nilMetadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request