View Source Nostrum.Cache.PresenceCache.ETS (Nostrum v0.10.0)

ETS-based cache for user presences.

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 multiple presences in the cache.

Returns a specification to start this module under a supervisor.

Add the given presence data to the cache.

Retrieve a presence from the cache.

Set up the cache's ETS table.

Start the supervisor.

Retrieve the ETS table reference used for the cache.

Update the given presence data in the cache.

Functions

Link to this function

bulk_create(guild_id, presences)

View Source (since 0.5.0)
@spec bulk_create(Nostrum.Struct.Guild.id(), [map()]) :: :ok

Bulk create multiple presences in the cache.

Link to this function

child_spec(init_arg)

View Source (since 0.5.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

create(presence)

View Source (since 0.5.0)
@spec create(map()) :: :ok

Add the given presence data to the cache.

Link to this function

get(guild_id, user_id)

View Source (since 0.5.0)

Retrieve a presence from the cache.

Link to this function

init(init_arg)

View Source (since 0.5.0)

Set up the cache's ETS table.

Link to this function

start_link(init_arg)

View Source (since 0.5.0)

Start the supervisor.

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

Retrieve the ETS table reference used for the cache.

Link to this function

update(new)

View Source (since 0.5.0)
@spec update(map()) :: {Nostrum.Struct.Guild.id(), presence | nil, presence} | :noop
when presence: Nostrum.Cache.PresenceCache.presence()

Update the given presence data in the cache.