Host-side wrappers around the worker's class oracle. Every :class slot on
the host carries an opaque handle: an integer for bootstrap host-runtime
classes (interned at connect-time via intern-host-classes!), or a UUID
string for project classes (minted by the worker on resolve-class-sym).
Host NEVER calls Class/forName, .isAssignableFrom, instance?, or
class-equality on a project class. Every relation routes through the
worker via class-rel.
Host-side wrappers around the worker's class oracle. Every `:class` slot on the host carries an opaque handle: an integer for bootstrap host-runtime classes (interned at connect-time via `intern-host-classes!`), or a UUID string for project classes (minted by the worker on `resolve-class-sym`). Host NEVER calls `Class/forName`, `.isAssignableFrom`, `instance?`, or class-equality on a project class. Every relation routes through the worker via `class-rel`.
Per-run memo for the pure oracle relations, keyed by request. Sound because
the worker's handle table is additive (handles never re-point), so
:equals/:assignable-from/class-name/resolve-class-sym are pure
functions of their handles for the life of the worker. Bound to one atom per
run by check-project; the default fresh atom keeps the oracle correct (just
un-shared) when no binding is installed. :instance? is never cached.
Per-run memo for the pure oracle relations, keyed by request. Sound because the worker's handle table is additive (handles never re-point), so `:equals`/`:assignable-from`/`class-name`/`resolve-class-sym` are pure functions of their handles for the life of the worker. Bound to one atom per run by `check-project`; the default fresh atom keeps the oracle correct (just un-shared) when no binding is installed. `:instance?` is never cached.
Bound by check-project after the bootstrap RPC. Map from host-imported
^Class to its integer handle. Lookup via host-handle.
Bound by `check-project` after the bootstrap RPC. Map from host-imported ^Class to its integer handle. Lookup via `host-handle`.
Per-run memo for worker apply-predicate results, keyed by [handle arg].
Sound because a Plumatic predicate is a pure function of its argument and the
worker's handle table is additive. Mirrors *class-rel-cache*: bound to one
atom per run by check-project, reused by pipeline sites via
current-predicate-cache. Only boolean results are cached; a predicate that
throws re-round-trips.
Per-run memo for worker `apply-predicate` results, keyed by `[handle arg]`. Sound because a Plumatic predicate is a pure function of its argument and the worker's handle table is additive. Mirrors `*class-rel-cache*`: bound to one atom per run by `check-project`, reused by pipeline sites via `current-predicate-cache`. Only boolean results are cached; a predicate that throws re-round-trips.
Bound by check-project to the live worker connection. All RPCs below
read from this var; nil means the host has no worker (test scaffolding only).
Bound by `check-project` to the live worker connection. All RPCs below read from this var; nil means the host has no worker (test scaffolding only).
The closed set of host-runtime classes whose names are guaranteed unique by
the JVM bootloader rules (D12). The host imports each one; the worker also
loads each one at connect-time. After intern-host-classes! these get
integer handles in host-class-handles.
The closed set of host-runtime classes whose names are guaranteed unique by the JVM bootloader rules (D12). The host imports each one; the worker also loads each one at connect-time. After `intern-host-classes!` these get integer handles in *host-class-handles*.
(cached-predicate handle arg thunk)Returns the cached boolean for [handle arg], else runs thunk, caches its
result, and returns it.
Returns the cached boolean for `[handle arg]`, else runs `thunk`, caches its result, and returns it.
(class-handle c)Inputs: [c] Returns: s/Any
A worker-recognized handle for a host-held ^Class. Bootstrap classes use
the cheap host-local handle; any other class is resolved by name through the
worker so the returned handle is comparable via class-rel. nil only if the
worker cannot resolve the name.
Inputs: [c] Returns: s/Any A worker-recognized handle for a host-held `^Class`. Bootstrap classes use the cheap host-local handle; any other class is resolved by name through the worker so the returned handle is comparable via `class-rel`. nil only if the worker cannot resolve the name.
(class-name a)Inputs: [a :- s/Any] Returns: s/Any
Asks the worker for the canonical name of the Class behind handle a.
Returns the name string, nil if a is nil/uninterned. The worker holds the
Class; the host never calls .getName on a project class.
Inputs: [a :- s/Any] Returns: s/Any Asks the worker for the canonical name of the Class behind handle `a`. Returns the name string, nil if `a` is nil/uninterned. The worker holds the Class; the host never calls `.getName` on a project class.
(class-rel rel a b)Inputs: [rel :- s/Keyword a :- s/Any b :- s/Any] Returns: s/Any
Routes a class relation to the worker. a is always a handle. For
:instance? b is a runtime value (worker uses it directly); otherwise
b is a handle. Returns boolean.
Inputs: [rel :- s/Keyword a :- s/Any b :- s/Any] Returns: s/Any Routes a class relation to the worker. `a` is always a handle. For `:instance?` `b` is a runtime value (worker uses it directly); otherwise `b` is a handle. Returns boolean.
(class-rel-batch triples)Inputs: [triples :- [#:s{Keyword s/Any}]] Returns: [s/Any]
Answers a vector of {:rel :a :b} triples, returning a vector of booleans
positionally matching triples. Cache hits never hit the wire; only the
uncached triples are sent in one class-rel-batch round-trip, then cached.
Inputs: [triples :- [#:s{Keyword s/Any}]]
Returns: [s/Any]
Answers a vector of `{:rel :a :b}` triples, returning a vector of booleans
positionally matching `triples`. Cache hits never hit the wire; only the
uncached triples are sent in one `class-rel-batch` round-trip, then cached.(current-cache)The currently-bound per-run cache atom. Pipeline sites reuse this when a run has already installed one, rather than shadowing it with a fresh atom.
The currently-bound per-run cache atom. Pipeline sites reuse this when a run has already installed one, rather than shadowing it with a fresh atom.
(current-predicate-cache)The currently-bound per-run predicate cache atom.
The currently-bound per-run predicate cache atom.
(handle? v)Inputs: [v :- s/Any] Returns: s/Bool
Discriminator: is v an opaque class handle? Integer (bootstrap) or
UUID-shaped string (project).
Inputs: [v :- s/Any] Returns: s/Bool Discriminator: is `v` an opaque class handle? Integer (bootstrap) or UUID-shaped string (project).
(host-handle c)Inputs: [c] Returns: s/Any
Returns the integer handle for c if c is a bootstrap-interned host
runtime class, else nil. Cheap host-local lookup; no RPC.
Inputs: [c] Returns: s/Any Returns the integer handle for `c` if `c` is a bootstrap-interned host runtime class, else nil. Cheap host-local lookup; no RPC.
(intern-host-classes! conn)Inputs: [conn :- s/Any] Returns: {Class s/Any}
Asks the worker to intern every bootstrap class. Returns a host-keyed map
{^Class handle-id} suitable for binding into host-class-handles.
Inputs: [conn :- s/Any]
Returns: {Class s/Any}
Asks the worker to intern every bootstrap class. Returns a host-keyed map
`{^Class handle-id}` suitable for binding into *host-class-handles*.(resolve-class-sym ns-name sym)Inputs: [ns-name :- s/Symbol sym :- s/Symbol] Returns: s/Any
Asks the worker to resolve sym in ns-name to a Class. Returns a UUID
handle on success, nil otherwise. Host never sees the Class.
Inputs: [ns-name :- s/Symbol sym :- s/Symbol] Returns: s/Any Asks the worker to resolve `sym` in `ns-name` to a Class. Returns a UUID handle on success, nil otherwise. Host never sees the Class.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |