async-refresh 0.2.0 → 0.2.0.2
raw patch · 6 files changed
+13/−15 lines, 6 filesdep +microlensdep +microlens-thdep −lens
Dependencies added: microlens, microlens-th
Dependencies removed: lens
Files
- README.md +4/−7
- async-refresh.cabal +3/−2
- src/Control/Concurrent/Async/Refresh.hs +3/−3
- src/Control/Concurrent/Async/Refresh/Lenses.hs +1/−1
- src/Control/Concurrent/Async/Refresh/Prelude.hs +1/−1
- src/Control/Concurrent/Async/Refresh/Types.hs +1/−1
README.md view
@@ -1,13 +1,11 @@-# async-refresh+# async-refresh [](https://hackage.haskell.org/package/async-refresh) [](https://www.stackage.org/package/async-refresh) [](https://travis-ci.org/mtesseract/async-refresh) -About-=====+### About This is Haskell library implementing the logic for refreshing of expiring data according to user-provided actions. -Usage-=====+### Usage - Create a new configuration using `newAsyncRefreshConf`, providing the action to be used for data refreshing.@@ -18,8 +16,7 @@ - Use `newAsyncRefresh` to initiate a new thread managing the asynchronous refreshing. -Example-=======+### Example The following IO action produces a `TVar` which is updated every ten seconds to contain the current time (wrapped in an `Either
async-refresh.cabal view
@@ -1,5 +1,5 @@ name: async-refresh-version: 0.2.0+version: 0.2.0.2 synopsis: Package implementing core logic for refreshing of expiring data. description: This package can be used for refreshing of expiring data according to a user-provided action. Using callbacks, the user can decide@@ -32,7 +32,8 @@ , MultiParamTypeClasses build-depends: base >= 4.7 && < 5 , text- , lens+ , microlens+ , microlens-th , monad-logger , lifted-async , stm
src/Control/Concurrent/Async/Refresh.hs view
@@ -34,12 +34,12 @@ , asyncRefreshAsync ) where +import Control.Concurrent.Async.Lifted.Safe (wait)+import qualified Control.Concurrent.Async.Refresh.Lenses as Lens import Control.Concurrent.Async.Refresh.Prelude-import Control.Concurrent.Async.Lifted.Safe (wait)-import qualified Control.Concurrent.Async.Refresh.Lenses as Lens import Control.Concurrent.Async.Refresh.Types import Control.Concurrent.Async.Refresh.Util-import Control.Lens+import Lens.Micro -- | Given a refresh action, create a new configuration. newAsyncRefreshConf :: MonadIO m => m (RefreshResult a) -> AsyncRefreshConf m a
src/Control/Concurrent/Async/Refresh/Lenses.hs view
@@ -17,6 +17,6 @@ module Control.Concurrent.Async.Refresh.Lenses where import Control.Concurrent.Async.Refresh.Types-import Control.Lens+import Lens.Micro.TH makeFields ''AsyncRefreshConf
src/Control/Concurrent/Async/Refresh/Prelude.hs view
@@ -37,7 +37,7 @@ import Formatting import Prelude hiding (head, tail, undefined)-import qualified Prelude as Prelude+import qualified Prelude -- | Version of 'undefined' with a deprecated pragma. undefined :: a
src/Control/Concurrent/Async/Refresh/Types.hs view
@@ -26,7 +26,7 @@ } -- | Data type denoting a running async refresher.-data AsyncRefresh =+newtype AsyncRefresh = AsyncRefresh { asyncRefreshAsync :: Async () } -- | Data type returned by async refresh actions.