Liking cljdoc? Tell your friends :D

hive-addon.runtime.boundary

Effectful boundary for client runtimes: runs the plans built by hive-addon.runtime.plan and provisions an injected addon's runtimes.

Effects go through two injected ports: IRuntimeFs for files and an eval-fn (fn [client commands]) for clients that are already running. local-fs is the production filesystem; recording-fs records effects for tests and can fail on demand. run-plan! never throws: it stops at the first failing effect and reports the rest as skipped.

provisioner is the composition a host passes to hive-addon.mount/mount! as :provision, and to teardown! as :deprovision.

Rationale lives in hive memory (KG-linked), not here.

Effectful boundary for client runtimes: runs the plans built by
hive-addon.runtime.plan and provisions an injected addon's runtimes.

Effects go through two injected ports: IRuntimeFs for files and an eval-fn
(fn [client commands]) for clients that are already running. `local-fs` is
the production filesystem; `recording-fs` records effects for tests and can
fail on demand. `run-plan!` never throws: it stops at the first failing
effect and reports the rest as skipped.

`provisioner` is the composition a host passes to hive-addon.mount/mount!
as :provision, and to teardown! as :deprovision.

Rationale lives in hive memory (KG-linked), not here.
raw docstring

declarationsclj

(declarations spec extra)

The runtimes to provision for SPEC: its own :addon/runtime followed by any a host supplies in EXTRA, a map of addon id to RuntimeDecls.

The runtimes to provision for SPEC: its own :addon/runtime followed by any a
host supplies in EXTRA, a map of addon id to RuntimeDecls.
sourceraw docstring

IRuntimeFscljprotocol

copy-tree!clj

(copy-tree! fs from to)

Copy the directory FROM to TO, creating TO.

Copy the directory FROM to TO, creating TO.

delete-tree!clj

(delete-tree! fs path)

Remove PATH and everything under it; absent is fine.

Remove PATH and everything under it; absent is fine.

write-file!clj

(write-file! fs path content)

Write CONTENT to PATH atomically, creating parents.

Write CONTENT to PATH atomically, creating parents.
source

local-fsclj

(local-fs)

The production filesystem.

The production filesystem.
sourceraw docstring

plan-ok?clj

(plan-ok? outcomes)
source

provision-runtime!clj

(provision-runtime! {:keys [fs eval-fn profiles home live?] :as opts}
                    instance
                    decl)

Install DECL for INSTANCE and, when :live? and an :eval-fn are given, activate it in running clients. Returns a RuntimeReport. Never throws.

opts: {:fs :eval-fn :profiles :home :live?}. Live activation failing does not fail the install: it is reported under :live-ok?.

Install DECL for INSTANCE and, when :live? and an :eval-fn are given,
activate it in running clients. Returns a RuntimeReport. Never throws.

opts: {:fs :eval-fn :profiles :home :live?}. Live activation failing does
not fail the install: it is reported under :live-ok?.
sourceraw docstring

provisionerclj

(provisioner {:keys [declarations home] :as opts})

A host's provisioning seam for hive-addon.mount: {:provision (fn [spec instance]) :deprovision (fn [addon-id]) :installed (fn [])}.

:provision returns a ProvisionReport, or nil when SPEC declares no runtime and the host supplies none. What was installed is remembered per addon id, so :deprovision removes exactly that.

opts: {:fs IRuntimeFs (default local-fs), :eval-fn (fn [client commands]), :profiles (default plan/default-profiles), :home (required), :declarations {addon-id RuntimeDecls}, :live? (default true)}

A host's provisioning seam for hive-addon.mount: {:provision (fn [spec
instance]) :deprovision (fn [addon-id]) :installed (fn [])}.

:provision returns a ProvisionReport, or nil when SPEC declares no runtime
and the host supplies none. What was installed is remembered per addon id,
so :deprovision removes exactly that.

opts: {:fs IRuntimeFs (default local-fs), :eval-fn (fn [client commands]),
       :profiles (default plan/default-profiles), :home (required),
       :declarations {addon-id RuntimeDecls}, :live? (default true)}
sourceraw docstring

recording-fsclj

(recording-fs)
(recording-fs fail-on)

A filesystem that records every effect in (:log fs) and throws on the effect kinds in FAIL-ON.

A filesystem that records every effect in (:log fs) and throws on the effect
kinds in FAIL-ON.
sourceraw docstring

run-effect!cljmultimethod

Perform one Effect with the ports in CTX ({:fs IRuntimeFs :eval-fn f}).

Perform one Effect with the ports in CTX ({:fs IRuntimeFs :eval-fn f}).
sourceraw docstring

run-plan!clj

(run-plan! ctx plan)

Run PLAN's effects in order. Returns a vector of Outcome, one per effect; after the first failure the remaining effects are not run and are reported :skipped?. Never throws.

Run PLAN's effects in order. Returns a vector of Outcome, one per effect;
after the first failure the remaining effects are not run and are reported
:skipped?. Never throws.
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