Permalink
Browse files

Made documentation for killers better

  • Loading branch information...
1 parent 2572508 commit 51c0c80358853871f7f4ea8e9db7abb8da6f237f @bobrik committed Oct 4, 2011
Showing with 23 additions and 4 deletions.
  1. +23 −4 README.markdown
View
@@ -57,11 +57,10 @@ about to daemonize). 'pid' will be the id of the running process, and
A function to be called if the start action cannot be performed. Error will be
some sort of stringifiable error object. Defaults to init.startFailed.
-### init.stop(pidfile, cb)
+### init.stop(pidfile, cb, killer)
-Sends your service TERM, INT, QUIT, in that order (with 2 second delays) and
-then KILL until the process is no longer running, then calls cb (defaults to
-init.stopped). If the process was running, cb's first argument will be true.
+Stops your service with one of shutdown functions. Default is
+`init.hardKiller(2000)`, but you may pass your own.
### init.status(pidfile, cb)
@@ -85,6 +84,26 @@ A string on which to dispatch. Defaults to your program's first argument
(process.argv[2]). Recognized actions are "start", "stop", "restart",
"try-restart", "force-reload", and "status".
+#### killer
+As in init.stop()
+
+Shutdown functions
+-----------------
+
+### init.hardKiller(delay = 2000)
+
+Sends your service TERM, INT, QUIT, in that order (with 2000 ms delays) and
+then KILL until the process is no longer running, then calls cb (defaults to
+init.stopped). If the process was running, cb's first argument will be true.
+This is default shutdown function.
+
+### init.softKiller(delay = 2000)
+
+Sends your service TERM and wait until it die with 2000 ms delays. This is
+preferred choice for graceful shutdown. Your service may decide when it want
+to stop with no data loss.
+
+
Default Actions
---------------
These functions are the defaults for various callbacks, but you can call them

0 comments on commit 51c0c80

Please sign in to comment.