erlang_adk_session_mnesia (erlang_adk v0.7.0)

View Source

erlang_adk_session_mnesia - Mnesia-backed implementation of adk_session_service.

Summary

Functions

Mnesia compare-and-append counterpart to the ETS session service.

Remove invocation-scoped temp: state after an invocation has completed.

Transactional Mnesia counterpart to compact_events/5.

Initialize the Mnesia tables. Call this if you intend to use Mnesia sessions.

Atomically read and remove one state value. Missing sessions and missing keys both return {error, not_found}.

Functions

add_event(AppName, UserId, SessionId, Event)

add_event_if_state(AppName, UserId, SessionId, Key, Expected, Event)

Mnesia compare-and-append counterpart to the ETS session service.

clear_temp_state(AppName, UserId, SessionId)

Remove invocation-scoped temp: state after an invocation has completed.

compact_events(AppName, UserId, SessionId, ExpectedIds, SummaryEvent)

Transactional Mnesia counterpart to compact_events/5.

create_session(AppName, UserId, Opts)

delete(SessionId)

delete_session(AppName, UserId, SessionId)

get_session(AppName, UserId, SessionId)

init()

Initialize the Mnesia tables. Call this if you intend to use Mnesia sessions.

list_sessions(AppName, UserId)

load(SessionId)

save(SessionId, Memory)

take_state(AppName, UserId, SessionId, Key)

Atomically read and remove one state value. Missing sessions and missing keys both return {error, not_found}.

update_state(AppName, UserId, SessionId, StateDelta)