{-# OPTIONS -XQuasiQuotes #-} module PushDecrease ( pushDecrease) where import MFlow.Wai.Blaze.Html.All import Control.Concurrent.STM import Text.Hamlet import Control.Concurrent atomic= liftIO . atomically pushDecrease= do tv <- liftIO $ newTVarIO 10 page $ [shamlet|
This example shows a reverse counter
To avoid unnecessary load, the push process will be killed when reaching 0
The last push message will be an script that will redirect to the menu"