KordCacheBuilder

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The default behavior for all types not explicitly configured, by default a concurrentHashMap is supplied.

Functions

Link copied to clipboard
Link copied to clipboard
fun build(): DataCache
Link copied to clipboard

Configures the caching for ChannelData.

Link copied to clipboard

Disables caching for all entries, clearing all custom generators and setting the default to none.

Link copied to clipboard

Configures the caching for EmojiData.

Link copied to clipboard

Configures the caching for EntitlementData.

Link copied to clipboard
fun <T : Any, I : Any> forDescription(description: DataDescription<T, I>, generator: Generator<T, I>?)
Link copied to clipboard

Configures the caching for GuildData.

Link copied to clipboard
fun <T : Any, I : Any> KordCacheBuilder.lruCache(size: Int = 100): Generator<T, I>

A Generator creating DataEntryCaches with a maximum size, removing items on last insertion. Shortcut for lruLinkedHashMap.

Link copied to clipboard

Configures the caching for MemberData. It's advised to configure user and member data similarly, so that every member in cache also has its user data cached. Failing to do so would result in a performance hit when fetching members.

Link copied to clipboard

Configures the caching for MessageData. Your application will generally handle a lot of messages during its lifetime, as such it's advised to limit the amount of messages cached in some way.

Link copied to clipboard
fun <T : Any, I : Any> none(): Generator<T, I>

A Generator creating DataEntryCaches that won't store any entities, can be used to disable caching.

Link copied to clipboard

Configures the caching for PresenceData.

Link copied to clipboard
fun roles(generator: Generator<RoleData, Snowflake>)

Configures the caching for RoleData.

Link copied to clipboard
Link copied to clipboard

Configures the caching for SubscriptionData.

Link copied to clipboard
fun users(generator: Generator<UserData, Snowflake>)

Configures the caching for UserData. It's advised to configure user and member data similarly, so that every member in cache also has its user data cached. Failing to do so would result in a performance hit when fetching members.

Link copied to clipboard

Configures the caching for VoiceStateData.

Link copied to clipboard

Configures the caching for WebhookData.