Async
public protocol Async : MonadDefer
Async models how a data type runs an asynchronous computation that may fail, described by the Proc signature.
-
Suspends side effects in the provided registration function. The parameter function is injected with a side-effectful callback for signaling the result of an asynchronous process.
Parameters
procfAsynchronous operation.
Return Value
A computation describing the asynchronous operation.
-
async(_:)Extension methodSuspends side effects in the provided registration function. The parameter function is injected with a side-effectful callback for signaling the result of an asynchronous process.
Parameters
procAsynchronous operation.
Return Value
A computation describing the asynchronous operation.
-
defer(_:_:)Extension methodProvides a computation that evaluates the provided function on every run.
Declaration
Parameters
queueDispatch queue which the computation must be sent to.
fFunction returning a value.
Return Value
A computation that defers the execution of the provided function.
-
later(_:_:)Extension methodProvides a computation that evaluates the provided function on every run.
Declaration
Swift
static func later<A>( _ queue: DispatchQueue, _ f: @escaping () throws -> A) -> Kind<Self, A>Parameters
queueDispatch queue which the computation must be sent to.
fFunction returning a value.
Return Value
A computation that defers the execution of the provided function.
-
delayOrRaise(_:_:)Extension methodProvides a computation that evaluates the provided function on every run.
Declaration
Parameters
queueDispatch queue which the computation must be sent to.
fA function that provides a value or an error.
Return Value
A computation that defers the execution of the provided value.
-
never()Extension methodProvides an asynchronous computation that never finishes.
Declaration
Swift
static func never<A>() -> Kind<Self, A>Return Value
An asynchronous computation that never finishes.
Install in Dash
Async Protocol Reference