3 ms·
Timeout: finish in 10 seconds. Deadline: finish at 7:15:35PM. The advantage of deadlines is that you can define a fixed deadline and then re-use it for any nu
by rumcajz 11y ago
Timeout: finish in 10 seconds.
Deadline: finish at 7:15:35PM.
The advantage of deadlines is that you can define a fixed deadline and then re-use it for any number of calls, without having to subtract the time already spent in previous calls.
- obstinate 11y agoYes, and if you set the deadline on the client, the server knows (subject to its time skew) when the request needs to finish. With a timeout, you have to factor in latency, which is necessarily error prone. Basically, deadline is a context-free timeout.
- huhtenberg 11y ago... unless, of course, it's on the wall clock scale, in which case changing machine time will invalidate all your deadlines. Just need to be careful to use something like 'ticks from the last boot' rather than UTC time.
- obstinate 11y agoIn competently run environments, wall clock changes are smeared. :) there is no way to use ticks since last boot, since the server will have a different value from the client.