-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | tiny no-brainer job scheduler -- -- this is a tiny library to make scheduling jobs to run at predetermined -- intervals, easier @package tiny-scheduler @version 0.1.4.2 -- | Time Interval Data Type to use to schedule jobs, (Secs, Minutes, -- Hours, Days), coupled along with convenience function to convert -- datatype to a rational number. Please note this data type guards -- against negative time which will result in 0 -- -- Additionmultiplicationdivision's resultant type instance will -- determined by the left operand -- -- Sec x + Day y = Sec z Day x + Minute y = Day z module TinyScheduler.Time data Interval Secs :: Rational -> Interval Minutes :: Rational -> Interval Hours :: Rational -> Interval Days :: Rational -> Interval Weeks :: Rational -> Interval intervalToSecs :: Interval -> Rational instance GHC.Show.Show TinyScheduler.Time.Interval instance GHC.Classes.Eq TinyScheduler.Time.Interval instance GHC.Num.Num TinyScheduler.Time.Interval -- | Main function that calculates thread delay associated with each job module TinyScheduler.Utils -- | this is the thread delay, calculated as [unit: microseconds)] -- (startTime - currentTime) + (interval * multiplier) calculateDelay :: Interval -> Int -> UTCTime -> UTCTime -> [Int] -- | Module for time atoms module TinyScheduler.TimeAtom -- | Composable Time atom data TimeAtom TimeAtom :: (UTCTime -> UTCTime -> [Int]) -> TimeAtom [delay_] :: TimeAtom -> UTCTime -> UTCTime -> [Int] -- | Exposed function to create time atoms makeTimeAtom :: Int -> Interval -> TimeAtom instance GHC.Base.Monoid TinyScheduler.TimeAtom.TimeAtom -- | Main Datatype to hold information about a job, and function to -- calculate thread delay module TinyScheduler.Jobs -- | Main datatype to hold job Information data Job a Job :: Int -> (UTCTime -> [Int]) -> IO a -> Job a [id] :: Job a -> Int [delay] :: Job a -> UTCTime -> [Int] [job] :: Job a -> IO a -- | Function to generate job from information about id, no of hits, -- interval | startTine and the a function with side effects makeJob :: Int -> Int -> Interval -> UTCTime -> IO a -> Job a -- | Convert time atom to Job timeAtomToJob :: Int -> IO a -> UTCTime -> TimeAtom -> Job a module TinyScheduler.SubJobs -- | Converts each hit of a job into a Subjob convertJobIntoSubJobs :: UTCTime -> Job a -> [SubJob a] execSubJobs :: [SubJob a] -> IO [a]