Skip to content

Instantly share code, notes, and snippets.

Last active Dec 17, 2015
What would you like to do?
def is_starved(conns):
for c in conns:
# the constant 0.85 is designed to *anticipate* starvation rather than wait for it
if c.in_flight > 0 and c.in_flight >= (c.last_ready * 0.85):
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment