Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data EpochClock a
- decode :: EpochTime -> UTCTime
- encode :: POSIXTime -> EpochTime
- getCurrentEpochTime :: IO EpochTime
- localEpochTimeFromUnix :: Word64 -> LocalTime
- runEpochClock :: ReplicaId -> IORef EpochTime -> EpochClock a -> IO a
- runEpochClockFromCurrentTime :: ReplicaId -> EpochClock a -> IO a
Documentation
data EpochClock a Source #
Real epoch clock. Uses kind of global variable to ensure strict monotonicity.
Instances
Monad EpochClock Source # | |
Defined in RON.Epoch (>>=) :: EpochClock a -> (a -> EpochClock b) -> EpochClock b # (>>) :: EpochClock a -> EpochClock b -> EpochClock b # return :: a -> EpochClock a # fail :: String -> EpochClock a # | |
Functor EpochClock Source # | |
Defined in RON.Epoch fmap :: (a -> b) -> EpochClock a -> EpochClock b # (<$) :: a -> EpochClock b -> EpochClock a # | |
Applicative EpochClock Source # | |
Defined in RON.Epoch pure :: a -> EpochClock a # (<*>) :: EpochClock (a -> b) -> EpochClock a -> EpochClock b # liftA2 :: (a -> b -> c) -> EpochClock a -> EpochClock b -> EpochClock c # (*>) :: EpochClock a -> EpochClock b -> EpochClock b # (<*) :: EpochClock a -> EpochClock b -> EpochClock a # | |
MonadIO EpochClock Source # | |
Defined in RON.Epoch liftIO :: IO a -> EpochClock a # | |
ReplicaClock EpochClock Source # | |
Defined in RON.Epoch getPid :: EpochClock ReplicaId Source # getEvents :: EpochTime -> EpochClock [EpochEvent] Source # advance :: EpochTime -> EpochClock () Source # |
getCurrentEpochTime :: IO EpochTime Source #
Get current time in EpochTime
format (with 100 ns resolution).
Monotonicity is not guaranteed.
localEpochTimeFromUnix :: Word64 -> LocalTime Source #
Convert unix time in hundreds of milliseconds to RFC 4122 time.
runEpochClock :: ReplicaId -> IORef EpochTime -> EpochClock a -> IO a Source #
Run EpochClock
action with explicit time variable.
runEpochClockFromCurrentTime :: ReplicaId -> EpochClock a -> IO a Source #
Like runEpochClock
, but initialize time variable with current wall time.