NIODeadline

Represents a point in time.

EventLoop.swift:809
struct NIODeadline

Stores the time in nanoseconds as returned by DispatchTime.now().uptimeNanoseconds

NIODeadline allow chaining multiple tasks with the same deadline without needing to compute new timeouts for each step

func doSomething(deadline: NIODeadline) -> EventLoopFuture<Void> {
    return step1(deadline: deadline).flatMap {
        step2(deadline: deadline)
    }
}
doSomething(deadline: .now() + .seconds(5))