View Source Nostrum.Cache.UserCache.ETS (Nostrum v0.8.0)

An ETS-based cache for users.

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 list of users from upstream data.

Returns a specification to start this module under a supervisor.

Create a user from upstream data.

Set up the ETS table.

Get a QLC query handle for the user cache.

Start the supervisor.

Retrieve the ETS table reference used for the cache.

Update a user from upstream data.

Link to this section Functions

Link to this function

bulk_create(users)

View Source (since 0.5.0)
@spec bulk_create(Enum.t()) :: :ok

Bulk create a list of users from upstream data.

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

View Source (since 0.5.0)
@spec create(map()) :: Nostrum.Struct.User.t()

Create a user from upstream data.

Link to this function

init(init_arg)

View Source (since 0.5.0)

Set up the ETS table.

Link to this function

query_handle()

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

Get a QLC query handle for the user cache.

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

View Source (since 0.5.0)
@spec update(map()) :: {Nostrum.Struct.User.t() | nil, Nostrum.Struct.User.t()}

Update a user from upstream data.