Types
TimedCache[K] = object of RootObj head, tail: TimedEntry[K] entries: Table[K, TimedEntry[K]] timeout: Duration
- Source Edit
TimedEntry[K] = ref object of RootObj key: K addedAt: Moment expiresAt: Moment next, prev: TimedEntry[K]
- Source Edit
Procs
func addedAt[K](t: TimedCache[K]; k: K): Moment {....raises: [].}
- Source Edit
func contains[K](t: TimedCache[K]; k: K): bool {....raises: [].}
- Source Edit
func del[K](t: var TimedCache[K]; key: K): Opt[TimedEntry[K]] {....raises: [].}
- Source Edit
func expire(t: var TimedCache; now: Moment = Moment.now()) {....raises: [].}
- Source Edit
func init[K](T: type TimedCache[K]; timeout: Duration = Timeout): T:type {. ...raises: [].}
- Source Edit
func put[K](t: var TimedCache[K]; k: K; now = Moment.now()): bool {....raises: [].}
- Source Edit