Misc utilities used in nREPL's implementation (potentially also useful for anyone extending it).
Misc utilities used in nREPL's implementation (potentially also useful for anyone extending it).
(attach-self-enabled?)
Return true if the current process allows native agents to be attached from within the JVM itself.
Return true if the current process allows native agents to be attached from within the JVM itself.
(java-8?)
Util to check if we are using Java 8. Useful for features that behave differently after version 8.
Util to check if we are using Java 8. Useful for features that behave differently after version 8.
(jvmti-agent-enabled?)
Return true if nREPL is allowed to load its JVMTI agent at runtime.
Return true if nREPL is allowed to load its JVMTI agent at runtime.
(parse-java-version)
Parse Java version string according to JEP 223 and return version as a number.
Parse Java version string according to JEP 223 and return version as a number.
(requiring-resolve sym & [log?])
Resolves namespace-qualified sym per 'resolve'. If initial resolve fails, attempts to require sym's namespace and retries. Returns nil if sym could not be resolved.
Resolves namespace-qualified sym per 'resolve'. If initial resolve fails, attempts to require sym's namespace and retries. Returns nil if sym could not be resolved.
(resolve-in-session msg dynvar)
Given an nREPL message and a dynamic variable, return the value of that dynamic variable within the message's session, and only if override is missing, then get the current dynvar's value.. It is important to use this macro inside middleware that accesses dynamic variables and expects user to be able to rebind those variables inside user's session and the middleware to observe the effect. If you just dereference the dynamic variable, you'll get its value in the nREPL server context, not in the user session context.
Given an nREPL message and a dynamic variable, return the value of that dynamic variable within the message's session, and only if override is missing, then get the current dynvar's value.. It is important to use this macro inside middleware that accesses dynamic variables and expects user to be able to rebind those variables inside user's session and the middleware to observe the effect. If you just dereference the dynamic variable, you'll get its value in the nREPL server context, not in the user session context.
(response-for {:keys [session id]} & response-data)
Returns a map containing the :session and :id from the "request" msg
as well as all entries specified in response-data
, which can be one
or more maps (which will be merged), or key-value pairs.
(response-for msg :status :done :value "5") (response-for msg {:status :interrupted})
The :session value in msg
may be any Clojure reference type (to accommodate
likely implementations of sessions) that has an :id slot in its metadata,
or a string.
Returns a map containing the :session and :id from the "request" `msg` as well as all entries specified in `response-data`, which can be one or more maps (which will be merged), *or* key-value pairs. (response-for msg :status :done :value "5") (response-for msg {:status :interrupted}) The :session value in `msg` may be any Clojure reference type (to accommodate likely implementations of sessions) that has an :id slot in its metadata, or a string.
(returning x & body)
Executes body
, returning x
.
Executes `body`, returning `x`.
A list of var metadata attributes are safe to return to the clients. We need to guard ourselves against EDN data that's not encodeable/decodable with bencode. We also optimize the response payloads by not returning redundant metadata.
A list of var metadata attributes are safe to return to the clients. We need to guard ourselves against EDN data that's not encodeable/decodable with bencode. We also optimize the response payloads by not returning redundant metadata.
(sanitize-meta m)
Sanitize a Clojure metadata map such that it can be bencoded.
Sanitize a Clojure metadata map such that it can be bencoded.
(with-session-classloader & body)
Bind clojure.lang.Compiler/LOADER
to the context classloader. This is
required to get hotloading with pomegranate working under certain conditions.
Bind `clojure.lang.Compiler/LOADER` to the context classloader. This is required to get hotloading with pomegranate working under certain conditions.
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 |