diff --git a/README.md b/README.md index 5a3fb6a..cd919ca 100644 --- a/README.md +++ b/README.md @@ -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`