Signal Handling¶
The darc.signal
module contains the handlers for OS-level
signals, c.f. signal
, for the darc
module.
- darc.signal.exit_signal(signum=None, frame=None)[source]¶
Handler for exiting signals.
If the current process is not the main process, the function shall transfer the signal to the main process.
- Parameters:
- Return type:
See also
- darc.signal.generic_handler(signum=None, frame=None)[source]¶
Generic signal handler.
If the current process is not the main process, the function shall transfer the signal to the main process.
The function is to be registered through
signal.signal()
and calls all registered signal handlers from the_HANDLER_REGISTRY
mapping.- Parameters:
- Return type:
See also
- darc.signal.register(signum, handler, *, _index=None)[source]¶
Register signal handler.
- Parameters:
- Keyword Arguments:
_index – Position index for the signal handler function.
- Return type:
Union
[Callable
[[Signals
,FrameType
],Any
],int
,Handlers
,None
]
See also
The signal handler functions will be saved into
_HANDLER_REGISTRY
.