Skip to content

Instantly share code, notes, and snippets.

@alkis
alkis / the-case-for-deadlines.md
Last active April 19, 2018 12:49
The case for deadlines

The case for deadlines

Rust aims to be the foundation of fast and robust software. A thorn in that side is the choice of timeout-centric APIs for I/O and multithreading. I posit this was a bad choice and it needs to be remedied as soon as possible before more APIs proliferate this (possibly accidental) design decision.

Motivating example: time limited network client request

Task: connect to a remote server, send a request, receive response with an end-to-end timeout of 10 seconds.

Attempt #1

function remove-docker-containers
echo "Stop running shit"
docker stop (docker ps -q)
echo "Remove the whale shit"
docker rm (docker ps -a -q)
end
function remove-docker-images
remove-docker-containers