kanaloa
kanaloa copied to clipboard
Customizable way to handle timeouts
As suggested by @nsauro One idea is to provide a Backoff trait, which gets called for every timeout. An instance would need to be created per worker, and it is guaranteed to be threadsafe code, since it would be called from within the Actor's receive function. The idea would be that the user can provide their own implementation of how they want to handle timeouts. IE: exponential backoff, etc.
The trait's interface would just be
def handleTimeout(msg?) : Option[FiniteDuration]
We could easily provide a few different, basic implementations, including this algorithm here.