HoneyBee

public struct HoneyBee

The HoneyBee struct is the starting point for all HoneyBee processes. See start(on:) for more details.

  • start() defines and executes a HoneyBee recipe. For example:

    HoneyBee.start { root in
        root.setErrorHandler(funcE)
            .chain(funcA)
            .chain(funcB)
    }
    

    The above example declares a HoneyBee recipe with error handling provided by funcE and a serial execution of funcA then funcB. For more possible HoneyBee declaration patterns see Link

    Declaration

    Swift

    public static func start(on blockPerformer: AsyncBlockPerformer = DispatchQueue.global(), file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (SafeLink<Void>) -> Void)

    Parameters

    blockPerformer

    The block performer to begin the process in.

    file

    used for debugging

    line

    used for debugging

    defineBlock

    the define block is where you declare your process chain. The value passed into defineBlock is a RootLink.

  • start() defines and executes a HoneyBee recipe. For example:

    HoneyBee.start()
            .setErrorHandler(funcE)
            .chain(funcA)
            .chain(funcB)
    

    The above example declares a HoneyBee recipe with error handling provided by funcE and a serial execution of funcA then funcB. For more possible HoneyBee declaration patterns see Link

    Declaration

    Swift

    public static func start(on blockPerformer: AsyncBlockPerformer = DispatchQueue.global(), file: StaticString = #file, line: UInt = #line) -> SafeLink<Void>

    Parameters

    blockPerformer

    The block performer to begin the process in.

    file

    used for debugging

    line

    used for debugging

    Return Value

    a RootLink to being declaring your recipe.

  • A FaultResponse which will be invoked if a chained function does not invoke its callback. See Link. Defaults to .fail

    Declaration

    Swift

    public static var functionUndercallResponse: FaultResponse
  • A FaultResponse which will be invoked if a chained function invokes its callback more than once. See Link. Defaults to .warn

    Declaration

    Swift

    public static var functionOvercallResponse: FaultResponse
  • A FaultResponse which will be invoked if HoneyBee detects an internal failure. Defaults to .fail

    Declaration

    Swift

    public static var internalFailureResponse: FaultResponse
  • A FaultResponse which will be invoked if HoneyBee detects a conjoin operation between two links with different AsyncBlockPerformers. Defaults to .warn

    Declaration

    Swift

    public static var mismatchedConjoinResponse: FaultResponse
  • Utility function to retreive the block performer of a given link. This method is useful to implementors of custom link behaviors.

    See more

    Declaration

    Swift

    public static func getBlockPerformer<X>(of link: Link<X>) -> AsyncBlockPerformer

    Return Value

    the AsyncBlockPerformer of the given link.

  • Utility function to retreive the block performer of a given link. This method is useful to implementors of custom link behaviors.

    See more

    Declaration

    Swift

    public static func getBlockPerformer<X>(of link: SafeLink<X>) -> AsyncBlockPerformer

    Return Value

    the AsyncBlockPerformer of the given link.