Finalize

class nvidia_resiliency_ext.inprocess.finalize.ThreadedFinalize(timeout, fn, args=(), kwargs=None)[source]

Executes the provided finalize fn function with specified positional and keyword arguments in a separate threading.Thread.

Raises an exception if execution takes longer than the specified timeout.

Parameters:
  • timeout (timedelta) – timeout for a thread executing fn

  • fn (Callable[[...], Any]) – function to be executed

  • args (tuple[Any, ...] | None) – tuple of positional arguments

  • kwargs (dict[str, Any] | None) – dictionary of keyword arguments