util: implement tryOccupyTask