Hi Harit, The way to solve these is to add a state to Monitor where it is waiting for the replies from diskMonitor and memoryMonitor. You first send the requests to them, then transition to this waiting state. In the waiting state you handle responses from diskMonitor and memoryMonitor. Once you get the reply from both, you can prepare a report, and transition to the initial state again.
-Endre On Mon, May 25, 2015 at 8:22 PM, Harit Himanshu < [email protected]> wrote: > I am fairly new to akka and not sure about approaching this problem. > > - I have a `Monitor` actor that spawns 2 other actors as `DiskMonitor` and > `MemoryMonitor` > > - DiskMonitor checks the diskUsage and report DiskReport message > - MemoryMonitor checks the diskUsage and report MemoryReport message > > I want to combine the DiskReport and MemoryReport into Report Object and > send to to remote machine via an API. > > *Questions* > > Since DiskMonitor and MemoryMonitor both are actors they send the response > back to caller once they are done with their work > > *Monitor* > > diskMonitor ! DiskMonitorRequest > memoryMonitor ! MemoryMonitorRequest > > How would Monitor know that it has all the results that it needs so that > it can create Report object and send it via API? > > Are actors good way to approach this problem? > > I also read about future but I don't understand them well and not sure if > they would be helpful in this problem context > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Akka Team Typesafe - Reactive apps on the JVM Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
