yesod-session-persist-0.0.0.2: SQL session backend for Yesod
Safe HaskellSafe-Inferred
LanguageGHC2021

Yesod.Session.Memcache.Expiration

Synopsis

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.

See: https://github.com/dterei/memcache-hs/blob/83957ee9c4983f87447b0e7476a9a9155474dc80/Database/Memcache/Client.hs#L49-L59

This value is ~1960.