View Source Nostrum.Cache.PresenceCache.Mnesia (Nostrum v0.10.0)
An Mnesia-based cache for presences.
Please note that this module is only compiled if Mnesia is available on your system. See the Mnesia section of the State documentation for more information.
To retrieve the table name used by this cache, use table/0
.
Summary
Functions
Bulk create a chunk of presences for the given guild in the cache.
Returns a specification to start this module under a supervisor.
Clear any objects in the cache.
Add the given presence to the cache.
Retrieve a presence from the cache.
Set up the cache's Mnesia table.
Start the supervisor.
Retrieve the table name used by the cache.
Drop the table used for caching.
Update the given presence in the cache.
Wrap query operations in a transaction.
Functions
Bulk create a chunk of presences for the given guild in the cache.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec clear() :: {:atomic, :ok} | {:aborted, term()}
Clear any objects in the cache.
@spec create(map()) :: :ok
Add the given presence to the cache.
@spec get(Nostrum.Struct.Guild.id(), Nostrum.Struct.User.id()) :: {:ok, Nostrum.Cache.PresenceCache.presence()} | {:error, any()}
Retrieve a presence from the cache.
Set up the cache's Mnesia table.
Start the supervisor.
@spec table() :: atom()
Retrieve the table name used by the cache.
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}
Drop the table used for caching.
@spec update(map()) :: {Nostrum.Struct.Guild.id(), presence | nil, presence} | :noop when presence: Nostrum.Cache.PresenceCache.presence()
Update the given presence in the cache.
Wrap query operations in a transaction.