LifecycleHandler

public struct LifecycleHandler

Supported startup and shutdown method styles

  • Initialize a Lifecycle.Handler based on a completion handler.

    Declaration

    Swift

    public init(_ callback: @escaping (@escaping (Error?) -> Void) -> Void)

    Parameters

    callback

    the underlying completion handler

  • Asynchronous Lifecycle.Handler based on a completion handler.

    Declaration

    Swift

    public static func async(_ callback: @escaping (@escaping (Error?) -> Void) -> Void) -> LifecycleHandler

    Parameters

    callback

    the underlying completion handler

  • Asynchronous Lifecycle.Handler based on a blocking, throwing function.

    Declaration

    Swift

    public static func sync(_ body: @escaping () throws -> Void) -> LifecycleHandler

    Parameters

    body

    the underlying function

  • Noop Lifecycle.Handler.

    Declaration

    Swift

    public static var none: LifecycleHandler { get }