Timeouts for dequeues and get_next_statement in javascript