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

Link to this function

child_spec(init_arg)

View Source (since 0.8.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec clear() :: {:atomic, :ok} | {:aborted, term()}

Clear any objects in the cache.

Link to this function

create(channel)

View Source (since 0.8.0)
@spec create(map()) :: Nostrum.Struct.Channel.t()

Creates the given channel in the cache.

Link to this function

delete(id)

View Source (since 0.8.0)

Delete the channel from the cache by ID.

Link to this function

init(init_arg)

View Source (since 0.8.0)

Set up the cache's Mnesia table.

Link to this function

query_handle()

View Source (since 0.8.0)
@spec query_handle() :: :qlc.query_handle()

Retrieve a QLC query handle for the channel cache.

Link to this function

start_link(init_arg)

View Source (since 0.8.0)

Start the supervisor.

@spec table() :: atom()

Retrieve the table name used by the cache.

Link to this function

teardown()

View Source (since 0.8.0)
@spec teardown() :: {:atomic, :ok} | {:aborted, term()}

Drop the table used for caching.

Link to this function

update(channel)

View Source (since 0.8.0)

Update the given channel in the cache.

Link to this function

wrap_qlc(fun)

View Source (since 0.8.0)

Wrap QLC operations in a transaction.