august.memory
Install this source library with aug add https://github.com/GreenPandaStudios/augscript/src/stdlib/memory --as memory, then import its public names from memory.
Signatures show result types and checked errors. See packages to pin a release and language constructs for built-in types.
StoreFull
StoreFull() implements ErrorThe bounded store could not accept another live entry.
ExpiringStore
capability ExpiringStore<T implements Data>A bounded, expiring capability for immutable values. Each generic DI binding has its own table.
ExpiringStore.put
put(string key, T value, int expires, int now) unless StoreFullRemove expired entries, then store at most 512 live entries. Time is supplied by the caller.
Uses ExpiringStore.put.
ExpiringStore.take
take(string key, int now) returns optional TAtomically remove a value. Expired or absent entries return null.
Uses ExpiringStore.take.
ExpiringStore.get
get(string key, int now) returns optional TRead a live value without consuming it.
Uses ExpiringStore.get.
MemoryStore
MemoryStore<T implements Data>() implements ExpiringStore<T>A synchronized table with short critical sections and no I/O while locked.
MemoryStore.put
put(string key, T value, int expires, int now) unless StoreFullRemove expired entries, then store at most 512 live entries. Time is supplied by the caller.
Uses ExpiringStore<T>.put.
MemoryStore.take
take(string key, int now) returns optional TAtomically remove a value. Expired or absent entries return null.
Uses ExpiringStore<T>.take.
MemoryStore.get
get(string key, int now) returns optional TRead a live value without consuming it.
Uses ExpiringStore<T>.get.