when_ready hook. Called just after the server is started

This commit is contained in:
benoitc 2010-05-23 00:17:44 +02:00
parent f8fac58d73
commit 4005614ced
2 changed files with 15 additions and 1 deletions

View File

@ -97,7 +97,7 @@ class Arbiter(object):
self.pidfile.create(self.pid)
self.log.info("Arbiter booted")
self.log.info("Listening at: %s" % self.LISTENER)
self.cfg.when_ready(self)
def init_signals(self):
"""\

View File

@ -536,3 +536,17 @@ with Setting("pre_exec") as s:
The callable needs to accept a single instance variable for the Arbiter.
""")
with Setting("when_ready") as s:
s.section = "Server Hooks"
s.validator = validate_callable(1)
s.type = "callable"
def def_start_server(server):
pass
s.default = def_start_server
s.fmt_desc("""\
Called just after the server is started
The callable needs to accept a single instance variable for the Arbiter.
""")