afterglow.web.routes.web-repl

Provides a web interface for interacting with the Clojure environment.

clean-expired-bindings

(clean-expired-bindings web-sessions)

Clean out the dynamic variable bindings stored for web sessions which have expired. Ignores bindings whose keys are not strings, because they do not come from web sessions, but from hosting environments like afterglow-max which do not expire.

discard-bindings

(discard-bindings session-key)

Clean up the thread-local bindings stored for a non-web hosted repl session, such as those used by afterglow-max, which are not automatically timed out. session-key is the unique, non-String key used to identify the REPL session to do-eval.

do-eval

(do-eval txt session-key)

Evaluate an expression sent to the web REPL and return the result or an error description. Also supports evaluation of expressions in non-web hosting contexts like afterglow-max by passing in a unique non-String value for session-key. In such cases the thread local bindings will not be automatically cleaned up, and it is the responsibility of the hosting implementation to call discard-bindings when they are no longer needed.

handle-command

(handle-command req)

Route which processes a command typed into the web console.

page

(page)

Route which renders the web console interface.

with-session

macro

(with-session session-key & body)

Wrap the body in a session-specific set of dynamic variable bindings.