Commit 547f6f64 authored by Andreas Jung's avatar Andreas Jung

Zope2 startup: Zope will now send a ProcessStarting event when it

is ready to serve requests. You can subscribe to this event e.g.
for starting application-level threads. 
parent 3f0ddc3e
......@@ -78,6 +78,10 @@ Zope Changes
Features added
- Zope2 startup: Zope will now send a ProcessStarting event when it
is ready to serve requests. You can subscribe to this event e.g.
for starting application-level threads.
- Testing.ZopeTestCase: Introduced a "ZopeLite" test layer, making it
possible to mix ZTC and non-ZTC tests much more freely.
......
......@@ -30,6 +30,9 @@ except ImportError:
import ZConfig
from ZConfig.components.logger import loghandler
from zope.event import notify
from zope.app import appsetup
logger = logging.getLogger("Zope")
started = False
......@@ -85,6 +88,10 @@ class ZopeStarter:
def setConfiguration(self, cfg):
self.cfg = cfg
def sendEvents(self):
notify(appsetup.interfaces.ProcessStarting())
def prepare(self):
self.setupInitialLogging()
self.setupLocale()
......@@ -108,8 +115,10 @@ class ZopeStarter:
# emit a "ready" message in order to prevent the kinds of emails
# to the Zope maillist in which people claim that Zope has "frozen"
# after it has emitted ZServer messages.
logger.info('Ready to handle requests')
self.setupFinalLogging()
self.sendEvents()
def run(self):
# the mainloop.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment