Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Add documentation about the REPL #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,31 @@ The `exec`, `env`, `argv`, and `silent` configs are passed to the
the parent. Called in the context of the worker, so you can reply by
looking at `this`.

## REPL

Cluster-master provides a REPL into the master process so you can inspect
the state of your cluster. By default the REPL is accessible by a socket
written to the root of the directory, but you can override it with the
`CLUSTER_MASTER_REPL` environment variable. You can access the REPL with
[socat](http://www.dest-unreach.org/socat/) like so:

```
socat ./cluster-master-socket stdin
```

The REPL provides you with access to these objects or functions:

* `repl`
* `resize(n)`
* `restart(cb)`
* `quit()`
* `cluster`
* `size`
* `connections`
* `workers`
* `select(pid)`
* `pids`
* `ages`
* `states`
* `debug`
* `sock`