Debugging utilities.

exception mode.debug.Blocking

Exception raised when event loop is blocked.

class mode.debug.BlockingDetector(timeout: Union[datetime.timedelta, float, str], raises: Type[BaseException] = <class 'mode.debug.Blocking'>, **kwargs: Any)

Service that detects blocking code using alarm/itimer.


blockdetect = BlockingDetector(timeout=10.0) await blockdetect.start()

Keyword Arguments
  • timeout (Seconds) – number of seconds that the event loop can be blocked.

  • raises (Type[BaseException]) – Exception to raise when the blocking timeout is exceeded. Defaults to Blocking.

logger = <Logger mode.debug (WARNING)>