Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Yesod.Session.Memcache.Expiration
Synopsis
- data MemcacheExpiration
- noExpiration :: Expiration
- fromUTC :: MonadThrow m => UTCTime -> m Word32
- maxTimestamp :: Num a => a
- minTimestamp :: Num a => a
Documentation
data MemcacheExpiration Source #
Constructors
NoMemcacheExpiration | Do not set expiration times; memache will only evict when the cache is full |
UseMemcacheExpiration | Sessions will be stored in memcache with the same expiration time that we send to the HTTP client, the lesser of the idle and absolute timeouts. |
noExpiration :: Expiration Source #
Do not expire the session via Memcache's expiration mechanism.
Memcache will evict the session when the cache is full.
fromUTC :: MonadThrow m => UTCTime -> m Word32 Source #
Convert UTCTime
to Word32
, with possibility of failure.
This function guards against UTCTime values that, converted to a timestamp, would be too big or too small.
See maxTimestamp
and minTimestamp
for definitions of too 'big / small'.
maxTimestamp :: Num a => a Source #
Check to make sure we don't overflow.
4_294_967_295 is ~2096
minTimestamp :: Num a => a Source #
Minimum value that will be interpreted as a timestamp by Memcache
Values lower than this are considered to be "number of seconds" in the future to expire a key value pair. This is not/ the interpretation we want.
This value is ~1960.