Instance Methodswift-nio 2.72.0NIOCore
makeFailedFuture(_:)
Creates and returns a new EventLoopFuture
that is already marked as failed. Notifications will be done using this EventLoop
as execution NIOThread
.
func makeFailedFuture<T>(_ error: Error) -> EventLoopFuture<T>
Parameters
- error
the
Error
that is used by theEventLoopFuture
.
Returns
a failed EventLoopFuture
.
Other members in extension
Instance members
var executor: any SerialExecutor
func any(
) -> EventLoop An
EventLoop
forms a singularEventLoopGroup
, returning itself as ‘any’EventLoop
.func assertInEventLoop(file: StaticString, line: UInt
) Asserts that the current thread is the one tied to this
EventLoop
. Otherwise, if running in debug mode, the process will be abnormally terminated as per the semantics ofpreconditionFailure(_:file:line:)
. Never has any effect in release mode.func assertNotInEventLoop(file: StaticString, line: UInt
) Asserts that the current thread is not the one tied to this
EventLoop
. Otherwise, if running in debug mode, the process will be abnormally terminated as per the semantics ofpreconditionFailure(_:file:line:)
. Never has any effect in release mode.func close(
) throws Close this
EventLoop
.func enqueue(consuming ExecutorJob
) func flatScheduleTask<T>(deadline: NIODeadline, file: StaticString, line: UInt, @escaping () throws -> EventLoopFuture<T>
) -> Scheduled<T> Schedule a
task
that is executed by thisEventLoop
at the given time.func flatScheduleTask<T>(in: TimeAmount, file: StaticString, line: UInt, @escaping () throws -> EventLoopFuture<T>
) -> Scheduled<T> Schedule a
task
that is executed by thisEventLoop
after the given amount of time.func flatSubmit<T>(@escaping () -> EventLoopFuture<T>
) -> EventLoopFuture<T> Submit
task
to be run on thisEventLoop
.func makeCompletedFuture<Success>(Result<Success, Error>
) -> EventLoopFuture<Success> Creates and returns a new
EventLoopFuture
that is marked as succeeded or failed with the value held byresult
.func makeCompletedFuture<Success>(withResultOf: () throws -> Success
) -> EventLoopFuture<Success> Creates and returns a new
EventLoopFuture
that is marked as succeeded or failed with the value returned bybody
.func makeFutureWithTask<Return>(@escaping () async throws -> Return
) -> EventLoopFuture<Return> func makeIterator(
) -> EventLoopIterator Returns an
EventLoopIterator
over thisEventLoop
.func makePromise<T>(of: T.Type, file: StaticString, line: UInt
) -> EventLoopPromise<T> Creates and returns a new
EventLoopPromise
that will be notified using thisEventLoop
as executionNIOThread
.func makeSucceededFuture<Success>(Success
) -> EventLoopFuture<Success> Creates and returns a new
EventLoopFuture
that is already marked as success. Notifications will be done using thisEventLoop
as executionNIOThread
.func makeSucceededVoidFuture(
) -> EventLoopFuture<Void> Default implementation of
makeSucceededVoidFuture
: Return a fresh future (which will allocate).func next(
) -> EventLoop An
EventLoop
forms a singularEventLoopGroup
, returning itself as the ‘next’EventLoop
.func preconditionInEventLoop(file: StaticString, line: UInt
) Checks the necessary condition of currently running on the called
EventLoop
for making forward progress.func preconditionNotInEventLoop(file: StaticString, line: UInt
) Checks the necessary condition of currently not running on the called
EventLoop
for making forward progress.func scheduleRepeatedAsyncTask(initialDelay: TimeAmount, delay: TimeAmount, maximumAllowableJitter: TimeAmount, notifying: EventLoopPromise<Void>?, @escaping (RepeatedTask) -> EventLoopFuture<Void>
) -> RepeatedTask Schedule a repeated asynchronous task to be executed by the
EventLoop
with a fixed delay between the end and start of each task.func scheduleRepeatedAsyncTask(initialDelay: TimeAmount, delay: TimeAmount, notifying: EventLoopPromise<Void>?, @escaping (RepeatedTask) -> EventLoopFuture<Void>
) -> RepeatedTask Schedule a repeated asynchronous task to be executed by the
EventLoop
with a fixed delay between the end and start of each task.func scheduleRepeatedTask(initialDelay: TimeAmount, delay: TimeAmount, maximumAllowableJitter: TimeAmount, notifying: EventLoopPromise<Void>?, @escaping (RepeatedTask) throws -> Void
) -> RepeatedTask Schedule a repeated task to be executed by the
EventLoop
with a fixed delay between the end and start of each task.func scheduleRepeatedTask(initialDelay: TimeAmount, delay: TimeAmount, notifying: EventLoopPromise<Void>?, @escaping (RepeatedTask) throws -> Void
) -> RepeatedTask Schedule a repeated task to be executed by the
EventLoop
with a fixed delay between the end and start of each task.func submit<T>(@escaping () throws -> T
) -> EventLoopFuture<T> Submit
task
to be run on thisEventLoop
.
Show implementation details (3)
Hide implementation details
func _preconditionSafeToWait(file: StaticString, line: UInt
) func _promiseCompleted(futureIdentifier: _NIOEventLoopFutureIdentifier
) -> (file: StaticString, line: UInt)? Default implementation of
_promiseCompleted
: does nothing.func _promiseCreated(futureIdentifier: _NIOEventLoopFutureIdentifier, file: StaticString, line: UInt
) Default implementation of
_promiseCreated
: does nothing.