Handle tasks exits without polling