otx.utils#

Utility files.

Functions

append_signal_handler(sig_num, sig_handler)

Append the handler for a signal.

append_main_proc_signal_handler(sig_num, ...)

Append the handler for a signal triggered only by main process.

otx.utils.append_main_proc_signal_handler(sig_num: int, sig_handler: Callable) None[source]#

Append the handler for a signal triggered only by main process. The function appended at last is called first.

It’s almost same as append_signal_handler except that handler will be executed only by signal to process which registers handler.

Parameters:
  • sig_num (signal.Signals) – Signal number to add a handler to.

  • sig_handler (Callable) – Callable function to be executed when the signal is sent.

otx.utils.append_signal_handler(sig_num: int, sig_handler: Callable) None[source]#

Append the handler for a signal. The function appended at last is called first.

Parameters:
  • sig_num (signal.Signals) – Signal number to add a handler to.

  • sig_handler (Callable) – Callable function to be executed when the signal is sent.