Required Instance Methodswift-nio 2.72.0NIOCore
_preconditionSafeToWait(file:line:)
Must crash if it is not safe to call wait()
on an EventLoopFuture
.
func _preconditionSafeToWait(file: StaticString, line: UInt)
This method is a debugging hook that can be used to override the behaviour of EventLoopFuture.wait()
when called. By default this simply becomes preconditionNotInEventLoop
, but some EventLoop
s are capable of more exhaustive checking and can validate that the wait is not occurring on an entire EventLoopGroup
, or even more broadly.
This method should not be called by users directly, it should only be implemented by EventLoop
implementers that need to customise the behaviour.
Other requirements
View members
Hide members
This section is hidden by default because it contains too many (12) members.
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 execute(@escaping () -> Void
) Submit a given task 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 (2)
Hide implementation details
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.