homepage: https://github.com/mtesseract/async-refresh
changelog-type: ''
hash: ed7156c0618d26f27e1552ccd45d6cd6d9ba076c8816c70082b7ed755a317fbe
test-bench-deps:
  test-framework-hunit: -any
  test-framework: -any
  stm: -any
  base: -any
  text: -any
  criterion: -any
  HUnit: -any
  monad-logger: -any
  async-refresh: -any
maintainer: mtesseract@silverratio.net
synopsis: Package implementing core logic for refreshing of expiring data.
changelog: ''
basic-deps:
  stm: -any
  base: ! '>=4.7 && <5'
  text: -any
  safe-exceptions: -any
  monad-control: -any
  lens: -any
  formatting: -any
  lifted-async: -any
  monad-logger: -any
all-versions:
- '0.1.7'
author: Moritz Schulte
latest: '0.1.7'
description-type: markdown
description: ! "# async-refresh\n\nAbout\n=====\n\nThis is Haskell library implementing
  the logic for refreshing of\nexpiring data according to user-provided actions.\n\nUsage\n=====\n\n-
  Create a new configuration using `newAsyncRefreshConf`, providing\n  the action
  to be used for data refreshing.\n\n- Adjust the configuration using the `asyncRefreshConfSet*`
  functions,\n  in particular using `asyncRefreshConfSetCallback`.\n\n- Use `newAsyncRefresh`
  to initiate a new thread managing the\n  asynchronous refreshing.\n\nExample\n=======\n\nThe
  following IO action produces a `TVar` which is updated every ten\nseconds to contain
  the current time (wrapped in an `Either\nSomeException`, because refreshing may
  fail).\n\n```\nperiodicTimeUpdater :: IO (TVar (Either SomeException UTCTime))\nperiodicTimeUpdater
  = runStderrLoggingT $ do\n  timeStore <- liftIO $ newTVarIO (Left (toException NotFound))\n
  \ let conf = newAsyncRefreshConf (RefreshResult <$> liftIO getCurrentTime <*> pure
  Nothing)\n        & asyncRefreshConfSetLabel \"CurrentTime updated every 10 seconds\"\n
  \       & asyncRefreshConfSetDefaultInterval (10 * 10^3)\n        & asyncRefreshConfSetCallback
  (liftIO . atomically . writeTVar timeStore . fmap refreshResult)\n  _ <- newAsyncRefresh
  conf\n  return timeStore\n```\n"
license-name: BSD3

Update from Hackage at 2017-04-11T13:02:45Z
Update from Hackage at 2017-04-11T13:02:45Z
