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:
@@ -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)))))
|
||||
Reference in New Issue
Block a user