Malloy
Loading...
Searching...
No Matches
Public Member Functions | List of all members
malloy::http::sessions::storage Struct Referenceabstract

#include <storage.hpp>

Inheritance diagram for malloy::http::sessions::storage:
Inheritance graph
[legend]

Public Member Functions

virtual std::shared_ptr< sessioncreate (id_type id)=0
 
virtual std::shared_ptr< sessionget (const id_type &id)=0
 
virtual void destroy (id_type id)=0
 
virtual std::size_t destroy_expired (const std::chrono::seconds &max_lifetime)=0
 

Detailed Description

A session storage interface.

Member Function Documentation

◆ create()

virtual std::shared_ptr< session > malloy::http::sessions::storage::create ( id_type  id)
pure virtual

Create a new session.

Parameters
idThe session ID.
Returns
The created session.

Implemented in malloy::http::sessions::storage_memory.

◆ destroy()

virtual void malloy::http::sessions::storage::destroy ( id_type  id)
pure virtual

Destroy an existing session.

Parameters
idThe session ID.

Implemented in malloy::http::sessions::storage_memory.

◆ destroy_expired()

virtual std::size_t malloy::http::sessions::storage::destroy_expired ( const std::chrono::seconds &  max_lifetime)
pure virtual

Destroy any session older than a specified value. Sessions older than max_lifetime need to be destroyed.

Note
The session manager guarantees that max_lifetime is greater than zero.
Parameters
max_lifetimeThe maximum lifetime of a session.
Returns
The number of sessions that were expired/destroyed.

Implemented in malloy::http::sessions::storage_memory.

◆ get()

virtual std::shared_ptr< session > malloy::http::sessions::storage::get ( const id_type &  id)
pure virtual

Returns an existing session (if any)

Parameters
idThe session ID.
Returns
The session (if any).

Implemented in malloy::http::sessions::storage_memory.


The documentation for this struct was generated from the following file: