LifecycleHandler
public struct LifecycleHandler
Supported startup and shutdown method styles
-
Initialize a
Lifecycle.Handlerbased on a completion handler.Declaration
Swift
public init(_ callback: @escaping (@escaping (Error?) -> Void) -> Void)Parameters
callbackthe underlying completion handler
-
Asynchronous
Lifecycle.Handlerbased on a completion handler.Declaration
Swift
public static func async(_ callback: @escaping (@escaping (Error?) -> Void) -> Void) -> LifecycleHandlerParameters
callbackthe underlying completion handler
-
Asynchronous
Lifecycle.Handlerbased on a blocking, throwing function.Declaration
Swift
public static func sync(_ body: @escaping () throws -> Void) -> LifecycleHandlerParameters
bodythe underlying function
-
Noop
Lifecycle.Handler.Declaration
Swift
public static var none: LifecycleHandler { get }
View on GitHub
Install in Dash
LifecycleHandler Structure Reference