mode.debug

Debugging utilities.

exception mode.debug.Blocking

Exception raised when event loop is blocked.

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

Service that detects blocking code using alarm/itimer.

Examples

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: logging.Logger = <Logger mode.debug (WARNING)>