basilisp.contrib.nrepl-server

A port of nbb ‘s nREPL server implementation to Basilisp.

typeStreamOutFn
Var ops[source]

A map of operations supported by the nREPL server (as keywords) to function handlers for those operations.

fn (server-make opts)[source]

Create and return a socketserver.TCPServer serving nREPL clients according to opts.

See ops for the operations supported by the server.

The nREPL starts at the user namespace and binds *1, *2, *3 and *e to the ultimate, penultimate, antepenultimate evaluation result and last exception message respectively.

opts is a map of options with the following optional keys:

keyword :host:

The host address to bind to, defaults to 127.0.0.1

keyword :port:

The port number to listen to, defaults to 0 which means to pickup a random available port.

See on-connect for additionally supported opts keys.

Warning

All client connections share the same environment at the moment, which is the env that the server runs in. This could change in the future to isolate the clients interactions from each other.

Note

The session UUIDs are ignored and only created to satisfy the initial clone op.

fn (start-server!)[source]
fn (start-server! opts)

Create an nREPL server with server-make according to opts and serve clients forever.

It prints out the nrepl-server-signature message at startup for IDEs to pickup the host number to connect to.

opts is a map of options with the following optional keys:

keyword :host:

The host address to bind to, defaults to 127.0.0.1

keyword :port:

The port number to listen to, defaults to 0 which means to pickup a random available port.

keyword :nrepl-port-file:

The file to write the port number to, it defaults to .nrepl-port.

keyword :server*:

An atom to hold the server reference as returned from server-make , useful for testing.

See also

server-make