Add symbol-based cache eviction

Introduces a reference counting mechanism for symbols within the
`FileCache`. When a `SymbolChunkIter` is created, it increments the
reference count for its symbol. When the iterator is dropped, the
reference count is decremented. If a symbol's reference count drops to
zero, all cached data associated with that symbol is evicted from the
cache, freeing up memory. This prevents stale data from being held
indefinitely when no active iterators are using it.
This commit is contained in:
2026-03-29 21:40:30 +02:00
parent c32cc0f49c
commit 1f68371920
3 changed files with 106 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
;; Skip: data output to stdout
(do
(def ohlc (create-m1-stream "EURUSD"))
;; Sink: print returns void, so nothing is propagated downstream
(pipe ohlc
(fn [bar]
(print (.close bar)))))