pub fn register_task(task: TaskStateBase, set_app_state: &SetAppState) -> bool
Register a new task in AppState.