// Delay Scheduling in Psedo-code
When a heartbeat is received from node n:
if n has a free slot then:
compute maxAllowedLocality for pending tasks
if exists task t can launch on n with locality <= maxAllowedLocality:
else if waitTime > maxDelayTime:
// Wait for next round of scheduling