Set exit handler for signals.
PARAMETER | DESCRIPTION |
func | A callable object that takes an integer and an optional frame type as arguments and returns any value. TYPE: Callable[[int, Optional[FrameType]], Any] |
Source code in faststream/cli/supervisors/utils.py
| def set_exit(func: Callable[[int, Optional[FrameType]], Any]) -> None:
"""Set exit handler for signals.
Args:
func: A callable object that takes an integer and an optional frame type as arguments and returns any value.
Returns:
None
"""
for sig in HANDLED_SIGNALS:
signal.signal(sig, func)
|