Required Instance Methodswift-nio 2.81.0NIOCore

scheduleTask(deadline:_:)

Schedule a task that is executed by this EventLoop at the given time.

EventLoop.swift:286
@discardableResult @preconcurrency func scheduleTask<T>(deadline: NIODeadline, _ task: @escaping () throws -> T) -> Scheduled<T>

Parameters

deadline

The instant in time before which the task will not execute.

task

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

Returns

A Scheduled object which may be used to cancel the task if it has not yet run, or to wait on the completion of the task.