[linear2] merge fallout: restore optimization from #491 / 7b129e857

pull/612/head
David Wilson 5 years ago
parent 5c39f58edf
commit 619f4dee07

@ -405,15 +405,6 @@ CONNECTION_METHOD = {
} }
class Broker(mitogen.master.Broker):
"""
WorkerProcess maintains at most 2 file descriptors, therefore does not need
the exuberant syscall expense of EpollPoller, so override it and restore
the poll() poller.
"""
poller_class = mitogen.core.Poller
class CallChain(mitogen.parent.CallChain): class CallChain(mitogen.parent.CallChain):
""" """
Extend :class:`mitogen.parent.CallChain` to additionally cause the Extend :class:`mitogen.parent.CallChain` to additionally cause the

@ -294,6 +294,15 @@ def get_cpu_count(default=None):
return cpu_count return cpu_count
class Broker(mitogen.master.Broker):
"""
WorkerProcess maintains at most 2 file descriptors, therefore does not need
the exuberant syscall expense of EpollPoller, so override it and restore
the poll() poller.
"""
poller_class = mitogen.core.Poller
class Binding(object): class Binding(object):
""" """
Represent a bound connection for a particular inventory hostname. When Represent a bound connection for a particular inventory hostname. When
@ -530,7 +539,7 @@ class ClassicWorkerModel(WorkerModel):
See WorkerModel.get_binding(). See WorkerModel.get_binding().
""" """
if self.broker is None: if self.broker is None:
self.broker = mitogen.master.Broker() self.broker = Broker()
path = self._listener_for_name(inventory_name) path = self._listener_for_name(inventory_name)
if path != self.listener_path: if path != self.listener_path:

Loading…
Cancel
Save