basilisp.contrib.nrepl-server

A port of nbb’s nREPL server implementation to basilisp.

typeStreamOutFn
Var ops

A list of operations supported by the nrepl server.

fn (server-make opts)

Create and return a socketserver/TCPServer serving nREPL clients according to opts at 127.0.0.1 at a random available port.

See ops for the operation 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

:host The host address to bind to, defaults to 127.0.0.1.

: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.

Known limitations:

1. 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.

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

fn (start-server!)
fn (start-server! opts)

Create an nREPL server with server-make (of which see) according to opts if given, and serve clients for ever.

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

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

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

also see server-make for additionally supported opts keys.