You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
367 B
Clojure
15 lines
367 B
Clojure
(ns asciinema.component.mem-expiring-set
|
|
(:require [asciinema.boundary.expiring-set :as exp-set]))
|
|
|
|
(defrecord MemExpiringSet [store]
|
|
exp-set/ExpiringSet
|
|
|
|
(conj! [this value _expires-at]
|
|
(swap! store conj value))
|
|
|
|
(contains? [this value]
|
|
(contains? @store value)))
|
|
|
|
(defn mem-expiring-set [{:keys [store]}]
|
|
(->MemExpiringSet (or store (atom #{}))))
|