blockdetection
Context that raises an exception if process is blocking.
Uses ``SIGALRM`` to detect blocking functions.
def blockdetection(
timeout: int
) - > contextmanager
Context that raises an exception if process is blocking. Uses SIGALRM to detect blocking functions.
Parameters
| Name | Type | Description |
|---|---|---|
| timeout | int | The number of seconds to wait before triggering a SIGALRM to interrupt a blocking process. |
Returns
| Type | Description |
|---|---|
contextmanager | A context manager that arms a signal-based alarm for the duration of the block. |