abstract class HTTPSession::Storage(T)
- HTTPSession::Storage(T)
- Reference
- Object
Overview
A base class for implementing storage backends.
Included Modules
Direct Known Subclasses
Defined in:
storage.crInstance Method Summary
-
#[](session_id : String) : T | Nil
Fetches the storage value for session_id.
-
#[]=(session_id : String, session : T) : Nil
Sets the storage value for session_id.
-
#delete_expired(min : Time) : Nil
Deletes all expired storage values, i.e.
-
#fetch(session_id : String) : Entry(T) | Nil
Fetches an entry indicated by session_id.
-
#gc_interval : Time::Span
The interval for deleting expired session values.
-
#gc_interval=(gc_interval : Time::Span)
The interval for deleting expired session values.
-
#max_age : Time::Span
The maximum age.
-
#max_age=(max_age : Time::Span)
The maximum age.
-
#put(session_id : String, entry : Entry(T)) : Nil
Sets the entry for session_id.
-
#run_gc_loop
Runs a loop that call
#delete_expired
every interval of#gc_interval
.
Instance methods inherited from module HTTPSession::StorageInterface(T)
[](session_id : String) : T | Nil
[],
[]=(session_id : String, session : T) : Nil
[]=,
delete(session_id : String) : Nil
delete,
has?(session_id : String) : Bool
has?,
new_session_id : String
new_session_id
Instance Method Detail
def [](session_id : String) : T | Nil
#
Description copied from module HTTPSession::StorageInterface(T)
Fetches the storage value for session_id.
Returns nil
if no value exists.
def []=(session_id : String, session : T) : Nil
#
Description copied from module HTTPSession::StorageInterface(T)
Sets the storage value for session_id.
abstract
def delete_expired(min : Time) : Nil
#
Deletes all expired storage values, i.e. which have not been touched since time.
Fetches an entry indicated by session_id.
Returns nil
if no entry exists.
Sets the entry for session_id.