View Source Nostrum.Cache.MemberCache.Mnesia (Nostrum v0.9.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.

Set up the cache's Mnesia table.

Get a QLC query handle for the member 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.

Functions

Link to this function

bulk_create(guild_id, members)

View Source (since 0.8.0)

Bulk create a chunk of members for the given guild in the cache.

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() :: :ok

Clear any objects in the cache.

Link to this function

create(guild_id, payload)

View Source (since 0.8.0)

Add the given member to the given guild in the cache.

Link to this function

delete(guild_id, user_id)

View Source (since 0.8.0)

Remove the given member from the given guild in the cache.

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()

Get a QLC query handle for the member cache.

Link to this function

start_link(init_arg)

View Source (since 0.8.0)

Start the supervisor.

@spec table() :: atom()

Retrieve the Mnesia table name used for 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(guild_id, payload)

View Source (since 0.8.0)

Update the given member for the given guild in the cache.

Link to this function

wrap_qlc(fun)

View Source (since 0.8.0)

Wrap QLC operations in a transaction.