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
funcE
and a serial execution offuncA
thenfuncB
. For more possible HoneyBee declaration patterns seeLink
Declaration
Swift
public static func start(file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, DefaultDispatchQueue>) -> Void)
Parameters
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 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
funcE
and a serial execution offuncA
thenfuncB
. For more possible HoneyBee declaration patterns seeLink
Declaration
Swift
public static func start<P>(on blockPerformer: P, file: StaticString = #file, line: UInt = #line, _ defineBlock: @escaping (Link<Void, Never, P>) -> Void) where P : AsyncBlockPerformer
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 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
funcE
and a serial execution offuncA
thenfuncB
. For more possible HoneyBee declaration patterns seeLink
Declaration
Swift
public static func start(file: StaticString = #file, line: UInt = #line) -> Link<Void, Never, DefaultDispatchQueue>
Parameters
file
used for debugging
line
used for debugging
Return Value
a
SafeLink
to 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
funcE
and a serial execution offuncA
thenfuncB
. For more possible HoneyBee declaration patterns seeLink
Declaration
Swift
public static func start<P>(on blockPerformer: P, file: StaticString = #file, line: UInt = #line) -> Link<Void, Never, P> where P : AsyncBlockPerformer
Parameters
blockPerformer
The block performer to begin the process in.
file
used for debugging
line
used for debugging
Return Value
a
SafeLink
to being declaring your recipe. -
A
FaultResponse
which 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
FaultResponse
which 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
FaultResponse
which will be invoked if HoneyBee detects an internal failure. Defaults to .failDeclaration
Swift
public static var internalFailureResponse: FaultResponse { get set }
-
A
FaultResponse
which will be invoked if HoneyBee detects aconjoin
operation between two links with differentAsyncBlockPerformer
s. 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 : AsyncBlockPerformer
Return Value
the
AsyncBlockPerformer
of 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