Copyright | Plow Technologies LLC |
---|---|
License | MIT License |
Maintainer | Scott Murphy |
Safe Haskell | Safe |
Language | Haskell2010 |
>>>
let keyFcn = fst :: (Int,a) -> Int
>>>
lockingFunction <- makeLockingFunction 30 keyFcn
|
Documentation
makeLockingFunction :: forall k lockableState. (Key k, Show lockableState) => Int64 -> KeyFcn lockableState k -> IO ((lockableState -> IO ()) -> lockableState -> IO ()) Source
This locking Function is very simple It reads a key and assigns a time to it if that time has expored... then it unlocks if the nested action completes then it unlocks all concurrency and exception handling should be done inside the IO () Notice I say it unlocks, not that it kills a nascent thread. No such thing will happen automatically