NIODeadline

public struct NIODeadline : Equatable, Hashable

Represents a point in time.

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).then {
        step2(deadline: deadline)
    }
}
doSomething(deadline: .now() + .seconds(5))

Note

NIODeadline should not be used to represent a time interval
  • Declaration

    Swift

    public static func < (lhs: NIODeadline, rhs: NIODeadline) -> Bool
  • Declaration

    Swift

    public static func > (lhs: NIODeadline, rhs: NIODeadline) -> Bool