Liking cljdoc? Tell your friends :D

sci.interrupt

Opt-in, interrupt-fn aware overrides for core functions that iterate over host sequences without ever entering an interpreted function, and therefore never hit the per-fn-entry :interrupt-fn check.

This namespace is NOT loaded by default and adds nothing to a standard SCI build unless you require it. Merge clojure-core into your context's clojure.core namespace to make these functions interruptible:

(require '[sci.core :as sci]
         '[sci.interrupt :as interrupt])

(sci/init {:interrupt-fn my-interrupt-fn
           :namespaces {'clojure.core interrupt/clojure-core}})

Each override reads :interrupt-fn from the current context at call time and falls back to the native function when no :interrupt-fn is configured, so merging clojure-core is always safe.

Opt-in, interrupt-fn aware overrides for core functions that iterate over
host sequences without ever entering an interpreted function, and therefore
never hit the per-fn-entry `:interrupt-fn` check.

This namespace is NOT loaded by default and adds nothing to a standard SCI
build unless you require it. Merge `clojure-core` into your context's
`clojure.core` namespace to make these functions interruptible:

    (require '[sci.core :as sci]
             '[sci.interrupt :as interrupt])

    (sci/init {:interrupt-fn my-interrupt-fn
               :namespaces {'clojure.core interrupt/clojure-core}})

Each override reads `:interrupt-fn` from the current context at call time and
falls back to the native function when no `:interrupt-fn` is configured, so
merging `clojure-core` is always safe.
raw docstring

clojure-coreclj/s

Map of clojure.core symbol -> interrupt-fn aware replacement var. Each value is a real SCI var on the shared clojure.core namespace object (built via copy-vars/new-var, like the built-in core vars), so it carries proper :ns/:name/:sci/built-in metadata. Merge into {:namespaces {'clojure.core ...}}.

Map of `clojure.core` symbol -> interrupt-fn aware replacement var. Each value
is a real SCI var on the shared `clojure.core` namespace object (built via
`copy-vars/new-var`, like the built-in core vars), so it carries proper
`:ns`/`:name`/`:sci/built-in` metadata. Merge into `{:namespaces {'clojure.core ...}}`.
sourceraw docstring

get-interrupt-fnclj/s

(get-interrupt-fn ctx)

Returns the :interrupt-fn configured on ctx (as produced by sci/init), or nil when none was set. Use this from host functions you expose to make them interrupt-fn aware, e.g. (get-interrupt-fn (sci.ctx-store/get-ctx)).

Returns the `:interrupt-fn` configured on `ctx` (as produced by `sci/init`),
or nil when none was set. Use this from host functions you expose to make them
interrupt-fn aware, e.g. `(get-interrupt-fn (sci.ctx-store/get-ctx))`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close