Support for task.is_main_task and task.cancel_on_timeout