Insertion-ordered set of string keys with a hard capacity bound. Backs the two idempotency ledgers in ItemVault (retained-resource correlation ids in GdscriptInventoryBackend, craft request ids in CraftingService). Both need the same guarantee: a caller can retry a previously-successful operation and must still be recognized as a duplicate, but the bookkeeping must not grow without bound. When the bound is reached the OLDEST key is evicted (FIFO), so the most recent capacity keys are always retained. The previous behavior in both consumers was to clear the entire map, which silently made every tracked id replayable at once and discarded far more history than necessary (#300).
Source: addons/item_vault/backend/bounded_id_set.gd
Syntax
class BoundedIdSet extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
capacity | Property | Maximum number of keys retained. Oldest-first eviction at the bound. |
has | Method | |
add | Method | |
remove | Method | |
clear | Method | |
size | Method | |
keys | Method |