Copyright | Gautier DI FOLCO |
---|---|
License | ISC |
Maintainer | Gautier DI FOLCO <gautier.difolco@gmail.com> |
Stability | Stable |
Portability | Portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Control.Antikythera.Scheduling
Description
Run an action given a Periodicity
import Control.Antikythera runPeriodicityZonedTime (inclusiveRange (Min 8) (Max 23) hour .&& every 30 minute) $ putStrLn "Don't forget to hydrate"
Synopsis
- runPeriodicityUTCTime :: Periodicity UTCTime -> IO () -> IO ()
- runPeriodicityZonedTime :: Periodicity ZonedTimeWrapped -> IO () -> IO ()
- runPeriodicityZonedTime' :: Periodicity ZonedTime -> IO () -> IO ()
- runPeriodicity :: PositionInTime t -> Periodicity t -> IO () -> IO ()
- runPeriodicityWithHooks :: (t -> IO ()) -> IO () -> (a -> IO ()) -> PositionInTime t -> Periodicity t -> IO a -> IO ()
- data PositionInTime t = PositionInTime {
- getTime :: IO t
- delayMicroSeconds :: t -> t -> Integer
- utcTime :: PositionInTime UTCTime
- zonedTime :: PositionInTime ZonedTimeWrapped
- zonedTime' :: PositionInTime ZonedTime
Periodicity
runners
runPeriodicityUTCTime :: Periodicity UTCTime -> IO () -> IO () Source #
Run an action given a Periodicity
using system's UTCTime
Note: the action is run in the loop, consider using a dedicated thread as any exception would break it
runPeriodicityZonedTime :: Periodicity ZonedTimeWrapped -> IO () -> IO () Source #
Run an action given a Periodicity
using system's ZonedTime
(wrapped to accomodate combination operators)
Note: the action is run in the loop, consider using a dedicated thread as any exception would break it
runPeriodicityZonedTime' :: Periodicity ZonedTime -> IO () -> IO () Source #
Run an action given a Periodicity
using system's ZonedTime
Note: the action is run in the loop, consider using a dedicated thread as any exception would break it
Arguments
:: PositionInTime t | Fetch the time and compute the delay time |
-> Periodicity t | |
-> IO () | |
-> IO () |
Run an action given a Periodicity
Note: the action is run in the loop, consider using a dedicated thread as any exception would break it
runPeriodicityWithHooks Source #
Arguments
:: (t -> IO ()) | Hooks planned |
-> IO () | Hooks at time (before running the action) |
-> (a -> IO ()) | Hooks done |
-> PositionInTime t | Fetch the time and compute the delay time |
-> Periodicity t | |
-> IO a | |
-> IO () |
Run an action given a Periodicity
with hooks
Note: the action is run in the loop, consider using a dedicated thread as any exception would break it
Position in time
data PositionInTime t Source #
Fetch the time and compute the delay time
Constructors
PositionInTime | |
Fields
|
zonedTime :: PositionInTime ZonedTimeWrapped Source #
System's ZonedTime
(wrapped to accomodate combination operators)
zonedTime' :: PositionInTime ZonedTime Source #
System's ZonedTime