Akka seems like a dream. Unfortunately, like many other programs, documentation and examples are missing in some basic areas. Since the whole point is to provide a non-blocking, parallel io, why would they give the world a hello that just returns a string. Here's a crazy idea: having an agent for each word, translating it into another language, calling something on the Internet, and then returning the results.
Today I revolved around reading the documentation on Futures and Promises. One working example would eliminate all this.
I did a lot of concurrent programming with Future in the java concurrency package. For some reason, Akka stuff just seems too complicated. I am doing something very close to what I described above: receiving a request and having several agents running it over the Internet. I took the original generated project, in which there is a Wizard and a listener as a starting point, and it works fine, I just can’t find an easy way to return the aggregated results. I have a play-mini method that is being called. From there, I call a class method that sends messages to agents, and when they are executed, their results are combined and the caller is called. How can I make a future out of this? All documentation says not to block, but we must return from the REST request.
Does anyone know of such an example? Super simple. Thank.
source
share