View Source Nostrum.Cache.ChannelCache.Mnesia (Nostrum v0.8.0)
An Mnesia-based cache for channels outside of guilds.
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
Returns a specification to start this module under a supervisor.
Clear any objects in the cache.
Creates the given channel in the cache.
Delete the channel from the cache by ID.
Set up the cache's Mnesia table.
Retrieve a QLC query handle for the channel cache.
Start the supervisor.
Retrieve the table name used by the cache.
Drop the table used for caching.
Update the given channel in the cache.
Wrap QLC operations in a transaction.
Link to this section Functions
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()) :: Nostrum.Struct.Channel.t()
Creates the given channel in the cache.
@spec delete(Nostrum.Struct.Channel.id()) :: :noop | Nostrum.Struct.Channel.t()
Delete the channel from the cache by ID.
Set up the cache's Mnesia table.
@spec query_handle() :: :qlc.query_handle()
Retrieve a QLC query handle for the channel cache.
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(Nostrum.Struct.Channel.t()) :: {Nostrum.Struct.Channel.t() | nil, Nostrum.Struct.Channel.t()}
Update the given channel in the cache.
Wrap QLC operations in a transaction.