module Control.Concurrent.Async.Refresh.Types where
import Control.Concurrent.Async.Refresh.Prelude
type AsyncRefreshCallback m a = Either SomeException (RefreshResult a) -> m ()
data AsyncRefreshConf m a =
AsyncRefreshConf
{ forall (m :: * -> *) a. AsyncRefreshConf m a -> Int
_asyncRefreshConfDefaultInterval :: Int
, forall (m :: * -> *) a. AsyncRefreshConf m a -> m (RefreshResult a)
_asyncRefreshConfAction :: m (RefreshResult a)
, forall (m :: * -> *) a. AsyncRefreshConf m a -> Double
_asyncRefreshConfFactor :: Double
, forall (m :: * -> *) a.
AsyncRefreshConf m a -> AsyncRefreshCallback m a
_asyncRefreshConfCallback :: AsyncRefreshCallback m a
, forall (m :: * -> *) a. AsyncRefreshConf m a -> Maybe Text
_asyncRefreshConfLabel :: Maybe Text
}
newtype AsyncRefresh =
AsyncRefresh { AsyncRefresh -> Async ()
asyncRefreshAsync :: Async () }
data RefreshResult a =
RefreshResult { forall a. RefreshResult a -> a
refreshResult :: a
, forall a. RefreshResult a -> Maybe Int
refreshExpiry :: Maybe Int
} deriving (Int -> RefreshResult a -> ShowS
[RefreshResult a] -> ShowS
RefreshResult a -> String
(Int -> RefreshResult a -> ShowS)
-> (RefreshResult a -> String)
-> ([RefreshResult a] -> ShowS)
-> Show (RefreshResult a)
forall a. Show a => Int -> RefreshResult a -> ShowS
forall a. Show a => [RefreshResult a] -> ShowS
forall a. Show a => RefreshResult a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> RefreshResult a -> ShowS
showsPrec :: Int -> RefreshResult a -> ShowS
$cshow :: forall a. Show a => RefreshResult a -> String
show :: RefreshResult a -> String
$cshowList :: forall a. Show a => [RefreshResult a] -> ShowS
showList :: [RefreshResult a] -> ShowS
Show)