The bounded replay ring of one session: frames in ascending seq, oldest first.
It behaves like a PersistentQueue: conj appends, peek and pop take the
oldest frame. Two operations make it cheap to keep one materialized frame per key:
key-fn). The ring counts the frames of each key.remove-key scans back from the newest frame only until it has found every
frame of that key. A replaced frame is almost always near the tail.The frames are a persistent vector and an offset of popped slots. A pop clears its slot, so an evicted frame never stays reachable. The ring copies the live frames to a new vector once the offset reaches [[compact-at]].
A subvec of the whole history is not used: it retains the full backing vector.
The bounded replay ring of one session: frames in ascending seq, oldest first. It behaves like a `PersistentQueue`: `conj` appends, `peek` and `pop` take the oldest frame. Two operations make it cheap to keep one materialized frame per key: - Each frame can have a replace key (`key-fn`). The ring counts the frames of each key. - [[remove-key]] scans back from the newest frame only until it has found every frame of that key. A replaced frame is almost always near the tail. The frames are a persistent vector and an offset of popped slots. A pop clears its slot, so an evicted frame never stays reachable. The ring copies the live frames to a new vector once the offset reaches [[compact-at]]. A `subvec` of the whole history is not used: it retains the full backing vector.
(remove-frame ring frame)ring without the frame identical to frame.
`ring` without the frame identical to `frame`.
(remove-key ring k)[ring removed]: ring without its frames of replace key k, and those frames in
ring order. Scans back from the newest frame until it has seen all of them.
`[ring removed]`: `ring` without its frames of replace key `k`, and those frames in ring order. Scans back from the newest frame until it has seen all of them.
(retains? ring descriptor)True when the ring still owns this exact descriptor, not another use of its seq.
True when the ring still owns this exact descriptor, not another use of its seq.
(ring frames key-fn)frames as a ring that keys its frames with key-fn. A ring with this key-fn
comes back unchanged.
`frames` as a ring that keys its frames with `key-fn`. A ring with this `key-fn` comes back unchanged.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |