akka-in-action | Accompanying source code for akka in action
kandi X-RAY | akka-in-action Summary
kandi X-RAY | akka-in-action Summary
Accompanying source code for akka in action
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of akka-in-action
akka-in-action Key Features
akka-in-action Examples and Code Snippets
Community Discussions
Trending Discussions on akka-in-action
QUESTION
I am trying to implement a Java version of the "Up and Running" example from Manning's "Akka in Action" book. It is a simple Http server based on Actor Model for saving (just in memory) and retrieving some events. I have no problem saving the events. But I do have an issue when querying my actor system for events (all events).
This is the relevant (I've put triple dots instead of code that I think has nothing to do with my issue) code for BoxOffice
- parent actor for all TicketSeller
s (later are responsible for managing state for each event).
ANSWER
Answered 2019-Mar-07 at 11:19What is going wrong here is that there is blocking on the dispatcher.
On the JVM, threads backed by operating system threads, which are expensive both in memory and process scheduler overhead. One of the advantages of Akka is that it allows more efficient use of threads, by allowing you to run many actors on a smaller number of threads.
This is great, but does mean you should never perform a blocking call inside an actor. The CompletableFuture::join
call here is blocking, which likely is the cause of your problem.
By avoiding blocking calls and using async API's (such as CompletableFuture.allOf
) your problem should go away.
QUESTION
I'm quite new to Scala, Akka and SBT, so this issue is giving me some headache! I'm working with the book Akka in Action, where the author provides examples on Github: https://github.com/RayRoestenburg/akka-in-action On a clean clone of the repository, i was trying to have a look at the example in chapter-cluster.
As described in the book, the first thing to do is to start a seed node on the local machine with:
...ANSWER
Answered 2017-May-29 at 10:39Try this as your build.sbt:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install akka-in-action
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page