From f554ef518655d92492a39053b665ad2b069c56ee Mon Sep 17 00:00:00 2001 From: Sean McCullough Date: Mon, 7 Jan 2013 19:08:17 -0800 Subject: [PATCH] Add info about the sweet REPL in the README Describe how you use the REPL, how to change the path of the socket, and lists commands you can use in the REPL --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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`