Instance Methodswift-nio 2.72.0NIOEmbedded
execute(_:)
On an EmbeddedEventLoop
, execute
will simply use scheduleTask
with a deadline of now. This means that task
will be run the next time you call EmbeddedEventLoop.run
.
func execute(_ task: @escaping () -> Void)
Other members in extension
Type members
init(
) Initialize a new
EmbeddedEventLoop
.
Instance members
var executor: any SerialExecutor
var inEventLoop: Bool
func advanceTime(by: TimeAmount
) Runs the event loop and moves “time” forward by the given amount, running any scheduled tasks that need to be run.
func advanceTime(to: NIODeadline
) Runs the event loop and moves “time” forward to the given point in time, running any scheduled tasks that need to be run.
func run(
) Run all tasks that have previously been submitted to this
EmbeddedEventLoop
, either by callingexecute
or events that have been enqueued usingscheduleTask
/scheduleRepeatedTask
/scheduleRepeatedAsyncTask
and whose deadlines have expired.func scheduleTask<T>(deadline: NIODeadline, @escaping () throws -> T
) -> Scheduled<T> func scheduleTask<T>(in: TimeAmount, @escaping () throws -> T
) -> Scheduled<T> func shutdownGracefully(queue: DispatchQueue, @escaping (Error?) -> Void
)
Show implementation details (4)
Hide implementation details
func _preconditionSafeToSyncShutdown(file: StaticString, line: UInt
) func _preconditionSafeToWait(file: StaticString, line: UInt
) func _promiseCompleted(futureIdentifier: _NIOEventLoopFutureIdentifier
) -> (file: StaticString, line: UInt)? func _promiseCreated(futureIdentifier: _NIOEventLoopFutureIdentifier, file: StaticString, line: UInt
)