performWithTask(_:)
Run the async
function body
on an event loop in this group and return its result as an EventLoopFuture
.
This declaration has been renamed to EventLoopGroup.makeFutureWithTask(_:).
This declaration is deprecated.
func performWithTask<Value>(_ body: @escaping () async throws -> Value) -> EventLoopFuture<Value>
Parameters
- body
The
async
function to run.
Returns
An EventLoopFuture
which is completed when body
finishes. On success the future has the result returned by body
; if body
throws an error, the future is failed with that error.
This function can be used to bridge the async
world into an EventLoopGroup
.
See also EventLoop.performWithTask(_:)
, EventLoopPromise.completeWithTask(_:)