A Learning Algorithm for Real-Time Service in Vehicular Networks with Mobile-Edge Computing