View Source Nostrum.Cache.UserCache.Mnesia (Nostrum v0.8.0)
An Mnesia-based cache for users.
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
.
Link to this section Summary
Functions
Bulk create a chunk of users in the cache.
Returns a specification to start this module under a supervisor.
Clear any objects in the cache.
Create a user from upstream data.
Remove the given user from cache.
Set up the cache's Mnesia table.
Get a QLC query handle for the user cache.
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 QLC operations in a transaction.
Link to this section Functions
Bulk create a chunk of users 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(map()) :: Nostrum.Struct.User.t()
Create a user from upstream data.
@spec delete(Nostrum.Struct.User.id()) :: Nostrum.Struct.User.t() | :noop
Remove the given user from cache.
Set up the cache's Mnesia table.
@spec query_handle() :: :qlc.query_handle()
Get a QLC query handle for the user cache.
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(map()) :: {Nostrum.Struct.User.t() | nil, Nostrum.Struct.User.t()}
Update the given member for the given guild in the cache.
Wrap QLC operations in a transaction.