kanaloa icon indicating copy to clipboard operation
kanaloa copied to clipboard

Customizable way to handle timeouts

Open kailuowang opened this issue 7 years ago • 0 comments

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.

kailuowang avatar Jul 21 '16 21:07 kailuowang