Encore 3.111.0
Released under the Eclipse Public License - v 1.0
Core utils library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/encore "3.111.0"]
Namespaces
taoensso.encore
Extended core library for Clojure/Script that emphasizes: +Encore 3.112.0 Encore 3.112.0
Released under the Eclipse Public License - v 1.0
Core utils library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/encore "3.112.0"]Namespaces
taoensso.encore
Extended core library for Clojure/Script that emphasizes: * Cross-platform API * Flexibility * Performance diff --git a/index.cljs.html b/index.cljs.html index 9f280240..f612a2a3 100644 --- a/index.cljs.html +++ b/index.cljs.html @@ -1,6 +1,6 @@ -Encore 3.111.0 Encore 3.111.0
Released under the Eclipse Public License - v 1.0
Core utils library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/encore "3.111.0"]Namespaces
taoensso.encore
Extended core library for Clojure/Script that emphasizes: +Encore 3.112.0 Encore 3.112.0
Released under the Eclipse Public License - v 1.0
Core utils library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/encore "3.112.0"]Namespaces
taoensso.encore
Extended core library for Clojure/Script that emphasizes: * Cross-platform API * Flexibility * Performance diff --git a/index.html b/index.html index 4cccd09e..f7c4d2cd 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,3 @@ -Encore 3.111.0 \ No newline at end of file +Encore 3.111.0
Released under the Eclipse Public License - v 1.0
Core utils library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/encore "3.111.0"]Platforms
This project includes code for multiple platforms, please choose a platform to view its documentation:
Encore 3.112.0 \ No newline at end of file diff --git a/taoensso.encore.cljs.html b/taoensso.encore.cljs.html index f809df08..10a6db4f 100644 --- a/taoensso.encore.cljs.html +++ b/taoensso.encore.cljs.html @@ -1,6 +1,6 @@ -Encore 3.112.0
Released under the Eclipse Public License - v 1.0
Core utils library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/encore "3.112.0"]Platforms
This project includes code for multiple platforms, please choose a platform to view its documentation:
taoensso.encore documentation taoensso.encore
Extended core library for Clojure/Script that emphasizes: +taoensso.encore documentation taoensso.encore
Extended core library for Clojure/Script that emphasizes: * Cross-platform API * Flexibility * Performance @@ -460,15 +460,14 @@ Will conform on ANY match. If you need literal "*"s, use #"\*" regex instead. - - {:allow <spec> :deny <spec>} with specs as above. - Will conform iff `allow` spec matches AND `deny` spec does NOT. + - {:allow <spec> :disallow <spec>} with specs as above. + Will conform iff `allow` spec matches AND `disallow` spec does NOT. -Resulting conform fn is useful as allowlist and/or denylist. Example inputs: namespace strings, class names, ids, etc. Spec examples: *ns*, #{}, "*", "foo.bar", "foo.bar.*", #{"foo" "bar.*"}, - {:allow #{"foo" "bar.*"} :deny #{"foo.*.bar.*"}}, + {:allow #{"foo" "bar.*"} :disallow #{"foo.*.bar.*"}}, #"(foo1|foo2)\.bar".name-with-attrs
clj
cljs
(name-with-attrs sym args)
(name-with-attrs sym args attrs-merge)
Given a symbol and args, returns [<name-with-attrs-meta> <args> <attrs>] with support for `defn` style `?docstring` and `?attrs-map`.nanoid
clj
cljs
(nanoid)
(nanoid len)
Returns a random "Nano ID" of given length, Ref. <https://github.com/ai/nanoid>. Uses strong randomness when possible. See also `uuid-str`, `rand-id-fn`.rename-keys
clj
cljs
(rename-keys replacements m)
Returns a map like the one given, replacing keys using given {<old-new> <new-key>} replacements. O(min(n_replacements, n_m)).repeatedly-into
clj
cljs
(repeatedly-into coll n f)
Like `repeatedly` but faster and `conj`s items into given collection.require-telemere-if-present
macro
clj
cljs
added in Encore v3.68.0 (2023-09-25)
(require-telemere-if-present)
Experimental, subject to change without notice! -Requires Telemere if it's present, otherwise no-ops. +Requires Telemere if it's present, otherwise noops. For Cljs: needs ClojureScript >= v1.9.293, and must be placed at top of file. Used in cooperation with `signal!`.reset!?
clj
cljs
(reset!? atom_ val)
Atomically swaps value of `atom_` to `val` and returns true iff the atom's value changed. See also `reset-in!?`.reset-in!
clj
cljs
(reset-in! atom_ val)
(reset-in! atom_ ks val)
(reset-in! atom_ ks not-found val)
Like `reset!` but supports `update-in` semantics, returns <old-key-val>. @@ -629,7 +628,7 @@set-var-root!
macro
clj
cljs
added in Encore v3.75.0 (2024-01-29)
(set-var-root! var-sym root-val)
Sets root binding (value) of the var identified by given symbol, and returns the new value. Cross-platform. See also `update-var-root!`.signal!
macro
clj
cljs
added in Encore v3.68.0 (2023-09-25)
(signal! {:as opts, :keys [fallback elidable? location inst uid middleware sample-rate kind ns id level when rate-limit ctx parent trace? do let data msg error run & kvs]})
Experimental, subject to change without notice! Expands to `taoensso.telemere/signal!` call if Telemere is present, -otherwise expands to `fallback` form. +otherwise expands to arbitrary `fallback` form. MUST be used with `require-telemere-if-present`: diff --git a/taoensso.encore.html b/taoensso.encore.html index 36472b67..9136c830 100644 --- a/taoensso.encore.html +++ b/taoensso.encore.html @@ -1,6 +1,6 @@ -taoensso.encore documentation taoensso.encore
Extended core library for Clojure/Script that emphasizes: +taoensso.encore documentation taoensso.encore
Extended core library for Clojure/Script that emphasizes: * Cross-platform API * Flexibility * Performance @@ -476,15 +476,14 @@ Will conform on ANY match. If you need literal "*"s, use #"\*" regex instead. - - {:allow <spec> :deny <spec>} with specs as above. - Will conform iff `allow` spec matches AND `deny` spec does NOT. + - {:allow <spec> :disallow <spec>} with specs as above. + Will conform iff `allow` spec matches AND `disallow` spec does NOT. -Resulting conform fn is useful as allowlist and/or denylist. Example inputs: namespace strings, class names, ids, etc. Spec examples: *ns*, #{}, "*", "foo.bar", "foo.bar.*", #{"foo" "bar.*"}, - {:allow #{"foo" "bar.*"} :deny #{"foo.*.bar.*"}}, + {:allow #{"foo" "bar.*"} :disallow #{"foo.*.bar.*"}}, #"(foo1|foo2)\.bar".name-with-attrs
clj
cljs
(name-with-attrs sym args)
(name-with-attrs sym args attrs-merge)
Given a symbol and args, returns [<name-with-attrs-meta> <args> <attrs>] with support for `defn` style `?docstring` and `?attrs-map`.nanoid
clj
cljs
(nanoid)
(nanoid len)
Returns a random "Nano ID" of given length, Ref. <https://github.com/ai/nanoid>. Uses strong randomness when possible. See also `uuid-str`, `rand-id-fn`.rename-keys
clj
cljs
(rename-keys replacements m)
Returns a map like the one given, replacing keys using given {<old-new> <new-key>} replacements. O(min(n_replacements, n_m)).repeatedly-into
clj
cljs
(repeatedly-into coll n f)
Like `repeatedly` but faster and `conj`s items into given collection.require-telemere-if-present
macro
clj
cljs
added in Encore v3.68.0 (2023-09-25)
(require-telemere-if-present)
Experimental, subject to change without notice! -Requires Telemere if it's present, otherwise no-ops. +Requires Telemere if it's present, otherwise noops. For Cljs: needs ClojureScript >= v1.9.293, and must be placed at top of file. Used in cooperation with `signal!`.reset!?
clj
cljs
(reset!? atom_ val)
Atomically swaps value of `atom_` to `val` and returns true iff the atom's value changed. See also `reset-in!?`.reset-in!
clj
cljs
(reset-in! atom_ val)
(reset-in! atom_ ks val)
(reset-in! atom_ ks not-found val)
Like `reset!` but supports `update-in` semantics, returns <old-key-val>. @@ -634,7 +633,7 @@ Returns current sub/vector. Useful for maintaining limited-length histories, etc. -See also `rolling-list` (Clj only).runner
clj
added in Encore v3.68.0 (2023-09-25)
(runner {:as opts, :keys [mode buffer-size n-threads thread-name daemon-threads? shutdown-drain-msecs convey-bindings?], :or {mode :blocking, buffer-size 1024, n-threads 1, daemon-threads? true, convey-bindings? true, shutdown-drain-msecs 6000}})
Experimental, subject to change without notice! +See also `rolling-list` (Clj only).runner
clj
added in Encore v3.68.0 (2023-09-25)
(runner {:as opts, :keys [mode buffer-size n-threads thread-name drain-msecs auto-stop? convey-bindings? daemon-threads?], :or {mode :blocking, buffer-size 1024, n-threads 1, drain-msecs 6000, auto-stop? true, convey-bindings? true, daemon-threads? true}})
Experimental, subject to change without notice! Returns a new stateful "runner" such that: (runner f) ; Arity 1 call @@ -644,30 +643,43 @@ - `false` if runner experienced back-pressure (fn may/not execute). - `nil` if runner has stopped accepting new execution requests. + (deref runner) + Returns a promise that will be delivered once all pending execution + requests complete. + (runner) ; Arity 0 call - Instructs runner to permanently stop accepting new execution requests. - Returns promise iff runner's status changed with this call. - Deref promise to block until all current execution requests complete. + Causes runner to permanently stop accepting new execution requests. + On first call returns a promise that will be delivered once all pending + execution requests complete. On subsequent calls returns nil. -Runners provide ~similar capabilities to agents, but: +Runners are a little like agents, but: - Take nullary fns rather than unary fns of state. - Have no validators or watches. - - Have (configurable) back-pressure. + - Have configurable back-pressure. - Can have >1 thread (in which case fns may execute out-of-order!). -These properties make them useful as configurable async workers, etc. +These properties make them useful as configurable general-purpose async workers. Options include: - `:buffer-size` - Size of request buffer (max number of queued requests). - `:mode` - Back-pressure mechanism ∈ #{:blocking :dropping :sliding}. - Determines what happens when the request buffer is full and a new - request is made: - `:blocking` => Will block caller until buffer space is available - `:dropping` => Will drop the newest request (no-op) - `:sliding` => Will drop the oldest request - - `:n-threads` - Number of threads for asynchronously executing fns (servicing - request buffer). NB execution order may be non-sequential when n > 1.satisfies!
macro
clj
cljs
added in Encore v3.51.0 (2023-03-13)
(satisfies! protocol arg)
(satisfies! protocol arg {:keys [msg context param ...]})
(satisfies! protocol arg & {:keys [msg context param ...]})
If (satisfies? protocol arg) is true, returns arg. + + `:buffer-size` (default 1024) + Size of request buffer, and the max number of pending requests before + configured back-pressure behaviour is triggered (see `:mode`). + + `:mode` (default `:blocking`) + Back-pressure mode ∈ #{:blocking :dropping :sliding}. + Controls what happens when a new request is made while request buffer is full: + `:blocking` => Blocks caller until buffer space is available + `:dropping` => Drops the newest request (noop) + `:sliding` => Drops the oldest request + + `:n-threads` (default 1) + Number of threads to use for executing fns (servicing request buffer). + NB execution order may be non-sequential when n > 1. + + `:drain-msecs` (default 6000 msecs) + Maximum time (in milliseconds) to try allow pending execution requests to + complete during JVM shutdown.satisfies!
macro
clj
cljs
added in Encore v3.51.0 (2023-03-13)
(satisfies! protocol arg)
(satisfies! protocol arg {:keys [msg context param ...]})
(satisfies! protocol arg & {:keys [msg context param ...]})
If (satisfies? protocol arg) is true, returns arg. Otherwise throws runtime `ExceptionInfo` with `unexpected-arg!`. See `unexpected-arg!` for more info.satisfies?
macro
clj
cljs
added in Encore v3.75.0 (2024-01-29)
(satisfies? protocol x)
Faster `satisfies?` to work around CLJ-1814 until a proper upstream fix. May cache, so possibly inappropriate for dynamic work.sb-append
clj
cljs
(sb-append str-builder x)
(sb-append str-builder x & more)
Appends given string/s to given string builder. See also `str-builder.` @@ -697,7 +709,7 @@ or (apply f <old-session> args).set-var-root!
macro
clj
cljs
added in Encore v3.75.0 (2024-01-29)
(set-var-root! var-sym root-val)
Sets root binding (value) of the var identified by given symbol, and returns the new value. Cross-platform. See also `update-var-root!`.signal!
macro
clj
cljs
added in Encore v3.68.0 (2023-09-25)
(signal! {:as opts, :keys [fallback elidable? location inst uid middleware sample-rate kind ns id level when rate-limit ctx parent trace? do let data msg error run & kvs]})
Experimental, subject to change without notice! Expands to `taoensso.telemere/signal!` call if Telemere is present, -otherwise expands to `fallback` form. +otherwise expands to arbitrary `fallback` form. MUST be used with `require-telemere-if-present`: