Instance Method (Default implementation)swift-nio 2.81.0NIOCore

submit(_:)

Submit task to be run on this EventLoop.

EventLoop.swift:957
@preconcurrency func submit<T>(_ task: @escaping () throws -> T) -> EventLoopFuture<T>

Parameters

task

The synchronous task to run. As everything that runs on the EventLoop, it must not block.

Returns

An EventLoopFuture containing the result of task’s execution.

The returned EventLoopFuture will be completed when task has finished running. It will be succeeded with task’s return value or failed if the execution of task threw an error.