LifecycleShutdownHandler

public struct LifecycleShutdownHandler<State>

LifecycleHandler for shutting down stateful tasks. The state comes from a LifecycleStartHandler

  • Initialize a LifecycleShutdownHandler based on a completion handler.

    Declaration

    Swift

    public init(_ handler: @escaping (State, @escaping (Error?) -> Void) -> Void)

    Parameters

    handler

    the underlying completion handler

  • Asynchronous LifecycleShutdownHandler based on a completion handler.

    Declaration

    Swift

    public static func async(_ handler: @escaping (State, @escaping (Error?) -> Void) -> Void) -> LifecycleShutdownHandler

    Parameters

    handler

    the underlying async handler

  • Asynchronous LifecycleShutdownHandler based on a blocking, throwing function.

    Declaration

    Swift

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

    Parameters

    body

    the underlying function