antikythera-0.1.0.0: Simple job/task/event scheduler/cronjob
CopyrightGautier DI FOLCO
LicenseISC
MaintainerGautier DI FOLCO <gautier.difolco@gmail.com>
StabilityStable
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

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

runPeriodicity Source #

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)