amnesia v0.2.8 Amnesia.Event

This module implements helpers to handle mnesia events.

Link to this section Summary

Functions

Observe the given events with the given function.

Report an event, see mnesia:report_event.

Subscribe to events of a given category, see mnesia:subscribe.

Unsubscribe from events of a given category, see mnesia:unsubscribe.

Link to this section Types

Link to this type

activity()

activity() :: {:complete, Amnesia.Access.id()}
Link to this type

category()

category() :: system() | activity() | table()
Link to this type

system()

system() ::
  {:mnesia_up, node()}
  | {:mnesia_down, node()}
  | {:mnesia_checkpoint_activated, any()}
  | {:mnesia_overload, any()}
  | {:inconsistent_database, any()}
  | {:mnesia_fatal, charlist(), [any()], binary()}
  | {:mnesia_info, charlist(), [any()]}
  | {:mnesia_user, any()}
Link to this type

table()

table() ::
  {:write, tuple(), Amnesia.Access.id()}
  | {:delete_object, tuple(), Amnesia.Access.id()}
  | {:delete, {atom(), any()}, Amnesia.Access.id()}
  | {:write, atom(), tuple(), [tuple()], Amnesia.Access.id()}
  | {:delete, atom(), any(), [tuple()], Amnesia.Access.id()}

Link to this section Functions

Link to this function

observe(categories, fun)

observe(category() | [category()], (any() -> none())) :: pid()

Observe the given events with the given function.

Link to this function

report(event)

report(any()) :: :ok

Report an event, see mnesia:report_event.

Link to this function

subscribe(category)

subscribe(category()) :: none()

Subscribe to events of a given category, see mnesia:subscribe.

Link to this function

unsubscribe(category)

unsubscribe(category()) :: none()

Unsubscribe from events of a given category, see mnesia:unsubscribe.