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

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.

Retrieve the member for the given guild and user in the cache.

Set up the cache's ETS table.

Start the supervisor.

Retrieve the ETS table reference used for the cache.

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

Wrap long-running queries operations.

Functions

Link to this function

bulk_create(guild_id, members)

View Source (since 0.7.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.7.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.7.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.7.0)

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

Link to this function

get(guild_id, user_id)

View Source (since 0.7.0)

Retrieve the member for the given guild and user in the cache.

Link to this function

init(init_arg)

View Source (since 0.7.0)

Set up the cache's ETS table.

Link to this function

start_link(init_arg)

View Source (since 0.7.0)

Start the supervisor.

@spec table() :: :ets.table()

Retrieve the ETS table reference used for the cache.

Link to this function

update(guild_id, payload)

View Source (since 0.7.0)

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

Link to this function

wrap_query(fun)

View Source (since 0.10.0)
@spec wrap_query((-> query_result)) :: query_result when query_result: term()

Wrap long-running queries operations.

Safety

Any operations are surrounded by :ets.safe_fixtable. It is therefore recommended to finish your read quickly.