Consider the code below
func test() -> SignalProducer<String, Error> {
return SignalProducer<String, Error> { observer, _ in
...
}
}
test()
.on(value: { s in
print(s)
})
.retry(upTo: 2)
.start()
}
Is there a built-in way to retry n times, then (if it failed all the tries) execute some callback?
It's of course possible to introduce a local counter and count the failures in .on(failed: _)
and then do something if the counter equals n+1, but is there some other way to do it?