(current-time-ms)
A convenience wrapper around System/currentTimeMillis meant to help with time-sensitive tests (easy mocking).
A convenience wrapper around System/currentTimeMillis meant to help with time-sensitive tests (easy mocking).
(flush-now {:keys [connectors checkpoint-handler checkpoint cache-key last-flush
writes-buf metrics]})
Flush pending writes, and checkpoint state, if any.
Flush pending writes, and checkpoint state, if any.
(init &
{:keys [connectors checkpoint-handler init-fn merge-query-fn cache-key
writes-threshold millis-threshold]
:or {init-fn (constantly nil)
merge-query-fn merge
cache-key identity
writes-threshold 99
millis-threshold 1000}})
Initializes persistroids. Returns a stateful instance with which to perform basic read/write ops (supposedly with considerable speed gain). connectors: a collection of storage wrappers, adhering to the Connector protocol; if not provided a default in-mem implementation is used. writes-threshold: writes are buffered in memory, and are persisted if this threshold is crossed (default:99). millis-threshold: writes are buffered in memory, and are persisted if this threshold is crossed (default:1000ms since last flush). init-fn: values bootstrap logic when not found in store (default:returns nil). cache-key: cache identity determining logic, given args (default:identity). merge-query-fn: if multiple connectors are given, this logic determines how their returned values are to be merged into one (default:merge). checkpoint-handler: this logic may be used for DR scenarios; it is invoked each time writes are flushed to storage, to handle runtime stateful information needed for recovery later; such data may optionally be flagged like so: (assoc persistroids :checkpoint running-state)
Initializes persistroids. Returns a stateful instance with which to perform basic read/write ops (supposedly with considerable speed gain). connectors: a collection of storage wrappers, adhering to the Connector protocol; if not provided a default in-mem implementation is used. writes-threshold: writes are buffered in memory, and are persisted if this threshold is crossed (default:99). millis-threshold: writes are buffered in memory, and are persisted if this threshold is crossed (default:1000ms since last flush). init-fn: values bootstrap logic when not found in store (default:returns nil). cache-key: cache identity determining logic, given args (default:identity). merge-query-fn: if multiple connectors are given, this logic determines how their returned values are to be merged into one (default:merge). checkpoint-handler: this logic may be used for DR scenarios; it is invoked each time writes are flushed to storage, to handle runtime stateful information needed for recovery later; such data may optionally be flagged like so: (assoc persistroids :checkpoint running-state)
(read {:keys [cache cache-key metrics] :as persistroids} args)
Reads a single value, identified by args. If the value was not cached, it will be, when this call returns.
Reads a single value, identified by args. If the value was not cached, it will be, when this call returns.
(shutdown {:keys [connectors metrics] :as persistroids}
&
[disconnect-connectors?])
Shuts-down persistroids, optionally disconnecting connectors (default:false).
Shuts-down persistroids, optionally disconnecting connectors (default:false).
(write persistroids args value)
Writes a single value, identified by args.
Writes a single value, identified by args.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close