Execution

public final class Execution

Undocumented

  • Undocumented

    See more

    Declaration

    Swift

    public enum SignalType
  • The signal handler is run when the SIGINT, SIGHUP, or SIGTERM signal is received by the process. It is used to clean up before exiting the program, or to attempt to suppress the signal.

    Returns true if the program should exit, or false to keep running. The normal case would be to return true.

    Declaration

    Swift

    public typealias SignalHandler = (SignalType) -> Bool
  • Starts the main run loop and optionally installs a signal handler for the purpose of cleanup before terminating. The signal handler will be executed for SIGINT, SIGHUP and SIGTERM.

    Declaration

    Swift

    public static func runUntilTerminated(signalHandler: SignalHandler? = nil)

    Parameters

    signalHandler

    Optional signal handler to execute before the program is terminated. If the signal handler returns false, the program will suppress the signal and not exit.