Add deadlines as an alternative to timeouts (#770)

Add deadlines as an alternative to timeouts

Motivation:

Address #603

Modifications:

- Add NIODeadline type
- Add func scheduleTask<T>(deadline: NIODeadline, _ task: @escaping () throws -> T) -> Scheduled<T>
- Reduce the use of DispatchTime in favor of Time
- Replace timeout calls with deadline calls where it makes sense

Result:

Tasks can be scheduled after an amount of time has passed, or at a certain time.
This commit is contained in:
David Skrundz authored and Johannes Weiss committed 2019-01-25 19:32:55 +00:00
1 parent de8d3e260e
commit 0eb85a4478
13 files changed
+172 -76

No files matched your search

@@ -13,7 +13,6 @@
//===----------------------------------------------------------------------===//
import XCTest
import Dispatch
import NIO
import NIOHTTP1