module Distributed.Failure.Class where

import           Data.Time


class FailureDetector d where
    {- | Add a liveness event to our set of evidence about the target.
     -   Specified as the amount of time that passed since the last evidence before it.
     -}
    observe :: d -> DiffTime -> d
    {- | If the failure detector suspects the target is faulty,
     -   given that the specified amount of time has passed since the last sample.
     -}
    suspected :: d -> DiffTime -> Bool

{-
class Accrual d where
    suspicion :: d -> DiffTime ->
-}