flatScheduleTask(deadline:file:line:_:)

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

EventLoop.swift:1070
@discardableResult @preconcurrency func flatScheduleTask<T>(deadline: NIODeadline, file: StaticString = #fileID, line: UInt = #line, _ task: @escaping () throws -> EventLoopFuture<T>) -> Scheduled<T> where T : Sendable

Parameters

deadline

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

file

The file this function was called in, for debugging purposes.

line

The line this function was called on, for debugging purposes.

task

The asynchronous 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 full execution of the task, including its returned EventLoopFuture.