|
@@ -320,9 +320,7 @@ class WorkController(configurated):
|
|
|
self._finalize = Finalize(self, self.stop, exitpriority=1)
|
|
|
self.pidfile = pidfile
|
|
|
self.pidlock = None
|
|
|
- self.use_eventloop = (detect_environment() == 'default' and
|
|
|
- self.app.connection().is_evented and
|
|
|
- not self.app.IS_WINDOWS)
|
|
|
+ self.use_eventloop = self.should_use_eventloop()
|
|
|
|
|
|
|
|
|
|
|
@@ -388,6 +386,10 @@ class WorkController(configurated):
|
|
|
except AttributeError:
|
|
|
pass
|
|
|
|
|
|
+ def should_use_eventloop(self):
|
|
|
+ return (detect_environment() == 'default' and
|
|
|
+ self.app.connection().is_evented and not self.app.IS_WINDOWS)
|
|
|
+
|
|
|
def stop(self, in_sighandler=False):
|
|
|
"""Graceful shutdown of the worker server."""
|
|
|
self.signal_consumer_close()
|