WardrikEvents.Heads (wardrik_events v0.1.0-rc.1)

Copy Markdown

Holds the events' settings, each log's last sequence number and each agent's activity in an ETS table.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the settings kept in the table heads.

Updates the value under key with fun. Returns {before, after}.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

settings(heads)

@spec settings(atom()) :: map()

Returns the settings kept in the table heads.

update(heads, key, initial, fun)

@spec update(atom(), term(), term(), (term() -> term())) :: {term(), term()}

Updates the value under key with fun. Returns {before, after}.

fun gets initial if key has no value. If another process updates key first, fun runs again on the new value.