View Source Nostrum.Cache.MemberCache.Mnesia (Nostrum v0.10.0)
An Mnesia-based cache for guild members.
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 members 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 member to the given guild in the cache.
Remove the given member from the given guild in the cache.
Retrieve the member for the given guild and user in the cache.
Set up the cache's Mnesia table.
Start the supervisor.
Retrieve the Mnesia table name used for the cache.
Drop the table used for caching.
Update the given member for the given guild in the cache.
Wrap long-running queries in a transaction.
Functions
Bulk create a chunk of members for the given guild in the cache.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec clear() :: :ok
Clear any objects in the cache.
@spec create(Nostrum.Struct.Guild.id(), map()) :: Nostrum.Struct.Guild.Member.t()
Add the given member to the given guild in the cache.
@spec delete(Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Member.user_id()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Member.t()} | :noop
Remove the given member from the given guild in the cache.
@spec get(Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Member.user_id()) :: {:ok, Nostrum.Struct.Guild.Member.t()} | {:error, any()}
Retrieve the member for the given guild and user in the cache.
Set up the cache's Mnesia table.
Start the supervisor.
@spec table() :: atom()
Retrieve the Mnesia table name used for the cache.
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}
Drop the table used for caching.
@spec update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Member.t() | nil, Nostrum.Struct.Guild.Member.t()}
Update the given member for the given guild in the cache.
Wrap long-running queries in a transaction.