processing = no work = () -> processing = yes doSomeWork (e) -> processing = no if not processing work() else int = setInterval () -> if not processing clearInterval int work() , 200