package session-redis-lwt

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Session_redis_lwtSource

Redis backend.

include Session.S.Future with type +'a io = 'a Lwt.t and type key = string and type value = string and type period = int64
Sourcetype +'a io = 'a Lwt.t

The type of a blocking computation that will produce a value of type 'a

Sourcetype t

The type of a handle on the backend.

Sourcetype key = string

The type of a session key.

Sourcetype value = string

The type of a session value.

Sourcetype period = int64

The type of a session expiry period.

Sourceval default_period : t -> period

default_period t returns default period after which session keys will expire. Depending on the backend, this value may vary over time.

Sourceval generate : ?expiry:period -> ?value:value -> t -> key io

generate ?expiry ?value t will allocate a new session in the backend t and return its associated key. The session will expire expiry seconds from now, defaulting to default_period t if 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.

Sourceval clear : t -> key -> unit io

clear t key removes key from the backend t. The backend may choose to persist the session value beyond this call. If it does any subsequent operations involving key behave as if it was not there.

get t key returns the session value, if present and unexpired, together with its expiry period as of now.

Sourceval set : ?expiry:period -> t -> key -> value -> unit io

set ?expiry t key value sets the value for the session associated key in backend t and sets the session to expire expiry seconds from now. If expiry is not provided, the expiry period reported by default_period t will be used instead.

Sourceval of_connection_pool : Redis_lwt.Client.connection Lwt_pool.t -> t
OCaml

Innovation. Community. Security.