Grokking Concurrency in Go
Vote

0% completed

​

Deadlines and Timeouts

A request handler has a budget of 250 ms to answer. To build the answer, it calls three services one after another, and each call takes 100 ms. The arithmetic does not work: 100 plus 100 plus 100 is 300 ms, which is 50 ms over the budget.

The handler can find this out in two ways. It can start the third call at 200 ms, let it run until the budget ends at 250 ms, and throw away 50 ms of work that could never finish. It can also check, at 200 ms, that only 50 ms remain and that a 100 ms call cannot fit, then stop without starting it.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content