embla-0.1: execute actions periodically while avoiding drift

Safe HaskellNone
LanguageHaskell2010

Embla

Description

This package is intended for use cases when cron is overkill, but the importance of avoiding drift is still there. No care is taken w.r.t. GC times.

Synopsis

Documentation

embla :: Int -> IO a -> IO a Source #

Given an IO action and an interval at which to perform it, perform the IO action repeatedly at every interval. This function is useful when you have an IO action that can take a significant/variable amount of time, and you want to avoid drift.

Note: This function will not work as expected if the given IO action takes longer than the polling interval.

Note: No care is taken w.r.t. GC times.