Module watchdog
[hide private]
[frames] | no frames]

Module watchdog

source code

Classes [hide private]
  CallCancelled
Raised when a call is cancelled.
  Suspender
A context manager to temporarily suspend the watchdog for a block of code.
  CancellableCallThread
A worker thread used to execute a call which must be made cancellable.
Functions [hide private]
 
alive()
Inform the watchdog that the core is alive.
source code
 
_watcher() source code
 
_shouldRecoverAfterMinTimeout() source code
 
_recoverAttempt() source code
 
_crashHandler(exceptionInfo) source code
 
_notifySendMessageCancelled() source code
 
_COMError_init(self, hresult, text, details) source code
 
initialize()
Initialize the watchdog.
source code
 
terminate()
Terminate the watchdog.
source code
 
cancellableExecute(func, *args, **kwargs)
Execute a function in the main thread, making it cancellable.
source code
 
cancellableSendMessage(hwnd, msg, wParam, lParam, flags=0, timeout=60000)
Send a window message, making the call cancellable.
source code
Variables [hide private]
  CHECK_INTERVAL = 0.1
  NORMAL_CORE_ALIVE_TIMEOUT = 10
  MIN_CORE_ALIVE_TIMEOUT = 0.5
  RECOVER_ATTEMPT_INTERVAL = 0.05
  FROZEN_WARNING_TIMEOUT = 15
  safeWindowClassSet = set(['Internet Explorer_Server', '_WwG', ...
  isRunning = False
  isAttemptingRecovery = False
  _coreAliveEvent = threading.Event()
  _resumeEvent = threading.Event()
  _coreThreadID = windll.kernel32.GetCurrentThreadId()
  _watcherThread = None
hash(x)
  RPC_E_CALL_CANCELED = -2147418110
  _orig_COMError_init = comtypes.COMError.__init__
  cancellableCallThread = None
hash(x)
Function Details [hide private]

_crashHandler(exceptionInfo)

source code 
Decorators:
  • @ctypes.WINFUNCTYPE(ctypes.wintypes.LONG, ctypes.c_void_p)

_notifySendMessageCancelled()

source code 
Decorators:
  • @ctypes.WINFUNCTYPE(None)

cancellableExecute(func, *args, **kwargs)

source code 

Execute a function in the main thread, making it cancellable.

Parameters:
  • func (callable) - The function to execute.
  • ccPumpMessages (bool) - Whether to pump messages while waiting.
  • args - Positional arguments for the function.
  • kwargs - Keyword arguments for the function.
Raises:

cancellableSendMessage(hwnd, msg, wParam, lParam, flags=0, timeout=60000)

source code 

Send a window message, making the call cancellable. The timeout and flags arguments should usually be left at their default values. The call will still be cancelled if appropriate even if the specified timeout has not yet been reached.

Raises:

Variables Details [hide private]

safeWindowClassSet

Value:
set(['Internet Explorer_Server', '_WwG', 'EXCEL7',])