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.handlingErrrors(with: funcE) .chain(funcA) .chain(funcB) }The above example declares a HoneyBee recipe with error handling provided by
funcEand a serial execution offuncAthenfuncB. For more possible HoneyBee declaration patterns seeLinkDeclaration
Swift
public static func start(file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, DefaultDispatchQueue>) -> Void)Parameters
fileused for debugging
lineused for debugging
defineBlockthe define block is where you declare your process chain. The value passed into
defineBlockis aSafeLink. -
start()defines and executes a HoneyBee recipe. For example:HoneyBee.start { root in root.handlingErrrors(with: funcE) .chain(funcA) .chain(funcB) }The above example declares a HoneyBee recipe with error handling provided by
funcEand a serial execution offuncAthenfuncB. For more possible HoneyBee declaration patterns seeLinkDeclaration
Swift
public static func start<P>(on blockPerformer: P, file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, P>) -> Void) where P : AsyncBlockPerformerParameters
blockPerformerThe block performer to begin the process in.
fileused for debugging
lineused for debugging
defineBlockthe define block is where you declare your process chain. The value passed into
defineBlockis aSafeLink. -
start()defines and executes a HoneyBee recipe. For example:HoneyBee.start() .handlingErrrors(with: funcE) .chain(funcA) .chain(funcB)The above example declares a HoneyBee recipe with error handling provided by
funcEand a serial execution offuncAthenfuncB. For more possible HoneyBee declaration patterns seeLinkDeclaration
Swift
public static func start(file: StaticString = #file, line: UInt = #line) -> Link<Void, Never, DefaultDispatchQueue>Parameters
fileused for debugging
lineused for debugging
Return Value
a
SafeLinkto being declaring your recipe. -
start()defines and executes a HoneyBee recipe. For example:HoneyBee.start() .handlingErrrors(with: funcE) .chain(funcA) .chain(funcB)The above example declares a HoneyBee recipe with error handling provided by
funcEand a serial execution offuncAthenfuncB. For more possible HoneyBee declaration patterns seeLinkDeclaration
Swift
public static func start<P>(on blockPerformer: P, file: StaticString = #file, line: UInt = #line) -> Link<Void, Never, P> where P : AsyncBlockPerformerParameters
blockPerformerThe block performer to begin the process in.
fileused for debugging
lineused for debugging
Return Value
a
SafeLinkto being declaring your recipe. -
A
FaultResponsewhich will be invoked if a chained function does not invoke its callback. SeeLink. Defaults to .failDeclaration
Swift
public static var functionUndercallResponse: FaultResponse { get set } -
A
FaultResponsewhich will be invoked if a chained function invokes its callback more than once. SeeLink. Defaults to .warnDeclaration
Swift
public static var functionOvercallResponse: FaultResponse { get set } -
A
FaultResponsewhich will be invoked if HoneyBee detects an internal failure. Defaults to .failDeclaration
Swift
public static var internalFailureResponse: FaultResponse { get set } -
A
FaultResponsewhich will be invoked if HoneyBee detects aconjoinoperation between two links with differentAsyncBlockPerformers. Defaults to .warnDeclaration
Swift
public static var mismatchedConjoinResponse: FaultResponse { get set } -
Utility function to retreive the block performer of a given link. This method is useful to implementors of custom link behaviors.
Declaration
Swift
public static func getBlockPerformer<X, E, P>(of link: Link<X, E, P>) -> P where E : Error, P : AsyncBlockPerformerReturn Value
the
AsyncBlockPerformerof the given link. -
Undocumented
Declaration
Swift
public static func async<R, P>(on blockPerformer: P, callback: @escaping (R) -> Void, file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, P>) -> Link<R, Never, P>) -> Void where P: AsyncBlockPerformer -
Undocumented
Declaration
Swift
public static func async<R, E, P>(on blockPerformer: P, completion: @escaping (Result<R, E>) -> Void, file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, P>) -> Link<R, E, P>) -> Void where E: Error, P: AsyncBlockPerformer -
Undocumented
Declaration
Swift
public static func async<R>(callback: @escaping (R) -> Void, file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, DefaultDispatchQueue>) -> Link<R, Never, DefaultDispatchQueue>) -> Void -
Undocumented
Declaration
Swift
public static func async<R, E>(completion: @escaping (Result<R, E>) -> Void, file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, DefaultDispatchQueue>) -> Link<R, E, DefaultDispatchQueue>) -> Void where E: Error
HoneyBee Structure Reference