I am writing a simple solution for brute force login attempts. I need to add delay before sending the response if there were many failed attempts. What do you guys suggest to add delay for individual requests? It has to be per request so that the thread serving a particular resource should not be affected for the next request.
Thanks.
EDIT: According to this question when running on Apache on Webfaction time.sleep will delay the next request to the same resource.
So what could be an alternative to time.sleep in this case?