View Source Nostrum.Cache.MemberCache.ETS (Nostrum v0.8.0)
An ETS-based cache for members.
If you need to get the table reference for the table used by this module,
please use the table/0
function.
Link to this section 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 ETS table.
Get a QLC query handle for the member cache.
Start the supervisor.
Retrieve the ETS table reference used for the cache.
Update the given member for the given guild in the cache.
Wrap QLC operations.
Link to this section 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.
Set up the cache's ETS table.
@spec query_handle() :: :qlc.query_handle()
Get a QLC query handle for the member cache.
Start the supervisor.
@spec table() :: :ets.table()
Retrieve the ETS table reference used for the cache.
@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.
@spec wrap_qlc((() -> qlc_result)) :: qlc_result when qlc_result: term()
Wrap QLC operations.
safety
Safety
Any QLC operations are surrounded by :ets.safe_fixtable
. It is therefore
recommended to finish your read quickly.