Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 787 Bytes

retry.md

File metadata and controls

42 lines (28 loc) · 787 Bytes

Retry Operator

Overview

Implements a retry if a source Observable sends an error, resubscribe to it in the hopes that it will complete without error.

It accepts a shouldRetry func(error) bool function to determine whether an error should by retried.

Example

observable := rxgo.Just(1, 2, errors.New("foo"))().
	Retry(2, func(err error) bool {
		return err.Error() == "foo"
	})

Output:

1
2
1
2
1
2
foo

Options