Akka Actor: Starting with the simplest example

Source: Internet
Author: User

What is Akka. It provides the Actor programming model on the JVM-both concurrency and distribution. It was written by Scala, instead of the Actor of Scala itself. The Actor's vision is a heavyweight resource, capable of higher concurrency with a small amount of memory, something like a fiber, a process. One data comparison is the same 1GB memory, can create 2.7M actors, and threads can only create 4,096, for reference only, of course, Java will also be based on the thread pool to execute.

The Actor adds flexibility to the program and eases complexity (the standard compliment).

The so-called Action programming model takes into account concurrency and distribution, because it allows you to program without thinking about threads, thread configuration becomes the scope of deployment; Communication between actors can only send asynchronous messages, and actors may be distributed on the same JVM, different JVMs, or different physical machines.

Because the first example from Akka in action is a bit high, a simple example of the Akka actor is found on the web, from the easy Scala Akka actor examples (Hello, World Examp Les). Not purely translation, mainly for practiced hand, so not exactly the same: Read the full text >>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.