Module Lift.Thread_IO
Lift a synchronous S.Now backend to an asynchronous S.Future interface, using threads. This may add concurrency to the program, depending on how in_thread is implemented.
Parameters
IO : S.Thread_IONow : S.Now
Signature
type +'a io= 'a IO.tThe type of a blocking computation that will produce a value of type
'a
type t= Now.tThe type of a handle on the backend.
type key= Now.keyThe type of a session key.
type value= Now.valueThe type of a session value.
type period= Now.periodThe type of a session expiry period.
val default_period : t -> perioddefault_period treturns default period after which session keys will expire. Depending on the backend, this value may vary over time.
val generate : ?expiry:period -> ?value:value -> t -> key iogenerate ?expiry ?value twill allocate a new session in the backendtand return its associatedkey. The session will expireexpiryseconds from now, defaulting todefault_period tif one is not explicitly specified.The key should be unique, though it may not be in order to allow implementations that use randomness or hashing to conform to this interface.
val clear : t -> key -> unit ioclear t keyremoveskeyfrom the backendt. The backend may choose to persist the session value beyond this call. If it does any subsequent operations involvingkeybehave as if it was not there.