I am trying to collect health information for my application as
class HealthMonitor extends Actor with ActorLogging {
val statusReporter = new StatusReporter
val versionInfo = context.actorOf(Props[VersionInfo], "versionInfo")
val memoryInfo = context.actorOf(Props[MemoryInfo], "memoryInfo")
def receive = LoggingReceive {
case HealthReportRequest => log.debug("Generating Health Report")
println("Generating Health Report")
// todo (harit): should be concurrent calls and collect results
versionInfo ! VersionInfoRequest
memoryInfo ! MemoryInfoRequest
}
}
What I need
I need a way wherein I can collect responses from versionInfo
, memoryInfo
, and some other info later into 1 response and send it somewhere
and I do not want a sequential or want to block the calls, what is the best way?