(bind-yarn yarn yarn-target)
Redeclares yarn as a symlink to the yarn-target.
Redeclares yarn as a symlink to the yarn-target.
(declare-yarn nm)
Defines abstract yarn without an implementation, useful for making forward declarations.
Defines abstract yarn without an implementation, useful for making forward declarations.
(defyarn name docstring?)
(defyarn name docstring? [dependencies*] & body)
Defines yarn - computation node. Uses current ns to build qualified keyword as yarn id. Examples:
;; declare ::yarn-1 without a body
(defyarn yarn-1)
;; declare ::yarn-2 with docstring
(defyarn yarn-2 "documentation")
;; define ::yarn-3 without any inputs
(defyarn yarn-3 {} (rand-int 10))
;; define ::yarn-4 with inputs
(defyarn yarn-4 {x yarn-3} (str "Random is" x))
Defines yarn - computation node. Uses current *ns* to build qualified keyword as yarn id. Examples: ```clojure ;; declare ::yarn-1 without a body (defyarn yarn-1) ;; declare ::yarn-2 with docstring (defyarn yarn-2 "documentation") ;; define ::yarn-3 without any inputs (defyarn yarn-3 {} (rand-int 10)) ;; define ::yarn-4 with inputs (defyarn yarn-4 {x yarn-3} (str "Random is" x)) ```
(defyarn-method multiyarn-name dispatch-value bindings-vec & body)
Creates and installs a new method of multiyarn associated with dispatch-value.
Creates and installs a new method of multiyarn associated with dispatch-value.
(defyarn-multi name docstring? dispatch-yarn & multi-options)
Defines a new multiyarn. Dispatching is routed by the value of dispatch-yarn' using same mechanics as
defmultimacro. Optional parameters are
:hierarchyand
:default`.
Defines a new multiyarn. Dispatching is routed by the value of `dispatch-yarn' using same mechanics as `defmulti` macro. Optional parameters are `:hierarchy` and `:default`.
(enable-tracing!)
(enable-tracing! enable)
Globally enable knitty tracing.
Globally enable knitty tracing.
(register-yarn yarn)
(register-yarn yarn no-override)
Registers Yarn into the global registry, do nothing when yarn is already registed and no-override flag is true.
Registers Yarn into the global registry, do nothing when yarn is already registed and no-override flag is true.
(set-executor! executor)
(set-executor! executor shutdown-current)
Globally set knitty executor.
Globally set knitty executor.
(yank inputs yarns)
(yank inputs yarns & {:as opts})
Computes and adds missing nodes into 'inputs' map. Always returns deferred.
Computes and adds missing nodes into 'inputs' map. Always returns deferred.
(yank* inputs yarns)
(yank* inputs yarns opts)
Computes missing nodes. Always returns deferred resolved into YankResult. YankResult implements ILookup, Seqable, IObj, IKVReduce and IReduceInit.
Optinans are:
:executor
a instance of java.util.concurrent.Executor
which is used to run code;:preload
preload all values from input map;:bindings
flag, indicating that thread-local bindings should be captured and installed for yarns;:tracing
flag, do we need to capture tracing (introduce some perfomance penalties);:registry
a knitty registry with avalable yarns, usefull for mocking code.Computes missing nodes. Always returns deferred resolved into YankResult. YankResult implements ILookup, Seqable, IObj, IKVReduce and IReduceInit. Optinans are: - `:executor` a instance of `java.util.concurrent.Executor` which is used to run code; - `:preload` preload all values from input map; - `:bindings` flag, indicating that thread-local bindings should be captured and installed for yarns; - `:tracing` flag, do we need to capture tracing (introduce some perfomance penalties); - `:registry` a knitty registry with avalable yarns, usefull for mocking code.
(yank-error? ex)
Returns true when exception is rethrown by yank
.
Returns true when exception is rethrown by `yank`.
(yank1 inputs yarns)
(yank1 inputs yarn & {:as opts})
Computes and returns a single node.
Intended to be used in REPL sessions where there is needed to pick just a single yarn value.
Tracing is disabled, use wrapped yank*
if you need it.
Logically similar to:
(md/chain (yank inputs [::yarn-key]) ::yarn-key)
Computes and returns a single node. Intended to be used in REPL sessions where there is needed to pick just a single yarn value. Tracing is disabled, use wrapped `yank*` if you need it. Logically similar to: (md/chain (yank inputs [::yarn-key]) ::yarn-key)
(yarn k & exprs)
Returns yarn object (without registering into the global registry). May capture variables from outer scope.
Returns yarn object (without registering into the global registry). May capture variables from outer scope.
(yarn-prefer-method yarn-ref dispatch-val-x dispatch-val-y)
Causes the multiyarn to prefer matches of dispatch-val-x over dispatch-val-y
Causes the multiyarn to prefer matches of dispatch-val-x over dispatch-val-y
(yr->map yr)
Transforms result of yank*
into persistent map.
Transforms result of `yank*` into persistent map.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close