Execution
public final class Execution
Undocumented
-
Undocumented
See moreDeclaration
Swift
public enum SignalType
-
The signal handler is run when the
SIGINT
,SIGHUP
, orSIGTERM
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, orfalse
to keep running. The normal case would be to returntrue
.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
andSIGTERM
.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.