I am just starting to use monix, in part for scheduling repeated work in a long running app. I will manage exceptions but I would like that monix continue calling the given function even if I let pass some of them.
Now, from a simple test, once a repeated call is scheduled, it won't continue calling it once an exception arise :
// will print "Hi" repeatedly
scheduler.scheduleAtFixedRate(5.milliseconds, 2.milliseconds) {
println("Hi")
}
// will print "Hi" only once
scheduler.scheduleAtFixedRate(5.milliseconds, 2.milliseconds) {
println("Hi")
throw new RuntimeException("oups, forgot to catch that one")
}
Note: I create the scheduler to log exceptions and errors
EDIT:
I realize that it's a poor design to simply repeat that task upon failure. Instead I should actually setup a proper exception management system, with delayed restart.
Now, I don't see any functionalities in Monix to do that. So I'll have to do it my-self. I let the question in case someone has the same issue, and in case someone knows of a monix tooling that can be useful.