def start_periodic_monitoring_thread(self): if self.periodic_monitoring_thread is None and GEVENT_CONFIG.monitor_thread: # Note that it is possible for one real thread to # (temporarily) wind up with multiple monitoring threads, # if hubs are started and stopped within the thread. This shows up # in the threadpool tests. The monitoring threads will eventually notice their # hub object is gone. from gevent._monitor import PeriodicMonitoringThread from gevent.events import PeriodicMonitorThreadStartedEvent from gevent.events import notify_and_call_entry_points self.periodic_monitoring_thread = PeriodicMonitoringThread(self) if self.main_hub: self.periodic_monitoring_thread.install_monitor_memory_usage() notify_and_call_entry_points(PeriodicMonitorThreadStartedEvent( self.periodic_monitoring_thread)) return self.periodic_monitoring_thread
def start_periodic_monitoring_thread(self): if self.periodic_monitoring_thread is None and GEVENT_CONFIG.monitor_thread: # Note that it is possible for one real thread to # (temporarily) wind up with multiple monitoring threads, # if hubs are started and stopped within the thread. This shows up # in the threadpool tests. The monitoring threads will eventually notice their # hub object is gone. from gevent._monitor import PeriodicMonitoringThread from gevent.events import PeriodicMonitorThreadStartedEvent from gevent.events import notify_and_call_entry_points self.periodic_monitoring_thread = PeriodicMonitoringThread(self) if self.main_hub: self.periodic_monitoring_thread.install_monitor_memory_usage() notify_and_call_entry_points(PeriodicMonitorThreadStartedEvent( self.periodic_monitoring_thread)) return self.periodic_monitoring_thread
def _notify_patch(event, _warnings=None): # Raises DoNotPatch if we're not supposed to patch from gevent.events import notify_and_call_entry_points event._warnings = _warnings notify_and_call_entry_points(event)
def _notify_patch(event, _warnings=None): # Raises DoNotPatch if we're not supposed to patch from gevent.events import notify_and_call_entry_points event._warnings = _warnings notify_and_call_entry_points(event)