Bernhard
02/04/2019, 1:22 PMfun closestServiceContact(latitude: Double, longitude: Double): ClosestServiceContact? {
return runBlocking {
val locations = async(IO) {
locationRepository.find(SearchLocationQuery(latitude = latitude, longitude = longitude))
}
val businessAreas = async(IO) {
businessAreaRepository.simpleFullTextSearch()
}
val serviceContacts = async(IO) {
fullTextSearch()
}
val employees = async(IO) {
employeeRepository.fullTextSearch()
}
return@runBlocking findFirstMatchingContact(
locations.await(),
businessAreas.await(),
serviceContacts.await(),
employees.await()
)
}