Required Instance Methodswift-nio 2.72.0NIOCore
execute(_:)
Submit a given task to be executed by the EventLoop
@preconcurrency func execute(_ task: @escaping () -> Void)
Other requirements
Instance members
var executor: any SerialExecutor
Returns a
SerialExecutor
corresponding to thisEventLoop
.var inEventLoop: Bool
Returns
true
if the currentNIOThread
is the same as theNIOThread
that is tied to thisEventLoop
.false
otherwise.func enqueue(consuming ExecutorJob
) Submit a job to be executed by the
EventLoop
func makeSucceededVoidFuture(
) -> EventLoopFuture<Void> Return a succeeded
Void
future.func preconditionInEventLoop(file: StaticString, line: UInt
) Asserts that the current thread is the one tied to this
EventLoop
. Otherwise, the process will be abnormally terminated as per the semantics ofpreconditionFailure(_:file:line:)
.func preconditionNotInEventLoop(file: StaticString, line: UInt
) Asserts that the current thread is not the one tied to this
EventLoop
. Otherwise, the process will be abnormally terminated as per the semantics ofpreconditionFailure(_:file:line:)
.func scheduleTask<T>(deadline: NIODeadline, @escaping () throws -> T
) -> Scheduled<T> Schedule a
task
that is executed by thisEventLoop
at the given time.func scheduleTask<T>(in: TimeAmount, @escaping () throws -> T
) -> Scheduled<T> Schedule a
task
that is executed by thisEventLoop
after the given amount of time.func submit<T>(@escaping () throws -> T
) -> EventLoopFuture<T> Submit a given task to be executed by the
EventLoop
. Once the execution is complete the returnedEventLoopFuture
is notified.
Show implementation details (3)
Hide implementation details
func _preconditionSafeToWait(file: StaticString, line: UInt
) Must crash if it is not safe to call
wait()
on anEventLoopFuture
.func _promiseCompleted(futureIdentifier: _NIOEventLoopFutureIdentifier
) -> (file: StaticString, line: UInt)? Debug hook: complete a specific promise and return its creation location.
func _promiseCreated(futureIdentifier: _NIOEventLoopFutureIdentifier, file: StaticString, line: UInt
) Debug hook: track a promise creation and its location.