Liking cljdoc? Tell your friends :D

knitty.core


*executor*clj


*registry*clj


*tracing*clj


bind-yarnclj

(bind-yarn yarn yarn-target)

Redeclares yarn as a symlink to the yarn-target.

Redeclares yarn as a symlink to the yarn-target.
raw docstring

declare-yarncljmacro

(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.
raw docstring

defyarncljmacro

(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))
```
raw docstring

defyarn-methodcljmacro

(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.
raw docstring

defyarn-multicljmacro

(defyarn-multi name docstring? dispatch-yarn & multi-options)

Defines a new multiyarn. Dispatching is routed by the value of dispatch-yarn' using same mechanics asdefmultimacro. 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`.
raw docstring

enable-tracing!clj

(enable-tracing!)
(enable-tracing! enable)

Globally enable knitty tracing.

Globally enable knitty tracing.
raw docstring

register-yarnclj

(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.
raw docstring

set-executor!clj

(set-executor! executor)
(set-executor! executor shutdown-current)

Globally set knitty executor.

Globally set knitty executor.
raw docstring

yankcljmacro

(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.
raw docstring

yank*clj

(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.
 
raw docstring

yank-error?clj

(yank-error? ex)

Returns true when exception is rethrown by yank.

Returns true when exception is rethrown by `yank`.
raw docstring

yank1cljmacro

(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)
raw docstring

yarncljmacro

(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.
raw docstring

yarn-prefer-methodcljmacro

(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
raw docstring

yr->mapclj

(yr->map yr)

Transforms result of yank* into persistent map.

Transforms result of `yank*` into persistent map.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close