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.
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