Often people ask: what is the difference between Akka's actor and Scala's actor? The answer here is that, from the Actor model point of view, there is no difference, they all implement the actor model.Akka actors and Scala actors are both implementations of that model.All actors model says that your concurrency primitives is actors, which can:
receive a message and decide what does next depending on the content of the message, including:
Scala Beginner's intermediate-Advanced Classic (66th: Scala concurrent programming experience and its application in Spark source code) content introduction and video link2015-07-24DT Big Data Dream FactoryFrom tomorrow onwards, be a diligent person.Watch videos, videos, share videosDT Big Data Dream Factory-scala--Advanced Classic: 66th: The first experience of
, if users according to the age of user classification simple classification-youth. Middle age, old age. The basic characteristics of measuring user purchasing ability are divided into the following five categories: time processing characteristics. Location processing characteristics, consumption processing characteristics. Commodity type processing characteristics and potential purchase characteristics; Abstract classes define multiple hook functions according to the computed dimension. Realize
The Akka provides scalable, real-time transaction processing capabilities.The Akka is based on actor and provides location transparency.The 1GB heap can have 2.5 million actors.Horizontal expansion, vertical expansion, fault tolerance 3 ways to solve.The actor of the tree structure, each actor has state and behavior.DT Big Data Dream Factory public account: Dt_spark.DT Big Data Dream Factory's public number
The victory and defeat of the military are not in the future, and the shame of the bag is the male-douniu fighting, fighting, fighting...
It has been some time since I learned and used scala. At first, I learned scala mainly to learn the spark ecosystem. But after learning some scala features, I was deeply impressed by scala
into future, but it may cause performance problems and OOM. Solution to the blocking problem:
Place blocking calls in one or more actor-managed router. Make sure to configure a thread pool
When putting blocking into the future, you must ensure that there is a maximum number of future calls; otherwise, oom is easy. You can also configure a thread pool with an upper limit.
Use a single thread to manage a group of blocked resources and issue events through actor messages.
Actorref
State serial
Akka is a library written in Scala that simplifies writing fault-tolerant, highly scalable Java and Scala Actor model applications. It has been successfully used in the telecommunications industry. The system will hardly go down (high availability 99.9999999 per year only for Ms Downtime.)Calculate the pi with Akka and
Download akka
Introduction
Akka is a library written in scala. It is used to simplify the compilation of fault tolerant and highly scalable Java and Scala actor model applications. It has been successfully applied in the telecom industry. The system almost never goes down (High Availability 99.9999999% a year only 31
Build Akka development on IntelliJ idea.Reason for using idea: there is no need to spend time learning to configure; using idea will make it more natural and more intelligent.Support is better on MAVEN,SBT.Some of Maven's features are described, and Maven is much more used.Sample word Count code for a simple explanation.DT Big Data Dream Factory public account: Dt_spark.DT Big Data Dream Factory's public number is Dt_spark, every day will have big dat
")}//#printer-actor//#main-class Object Akkaquickstart Extends App {import greeter._//Create the ' Helloakka ' actor system val System:actorsystem = Actorsystem ("Helloa Kka ")//#create-actors//Create the printer actor Val printer:actorref = System.actorof (Printer.props," Printerac Tor ")//Create the ' greeter ' actors val howdygreeter:actorref = System.actorof (Greeter.props (" Howdy ", printer), "Howdygreeter") val hellogreeter:actorref = System.actorof (Greeter.props ("Hello", printer), "He
Install the SBT plug-in File--Setting---Plugins, enter SBT, select SBT, click the Install button.Idea will restart.Enter project name, New project, Scala, SBT.DT Big Data Dream Factory public account: Dt_spark.DT Big Data Dream Factory's public number is Dt_spark, every day will have big data actual combat video release, please continue to study.Liaoliang DT Big Data dream factory Scala all videos, PPT and
Actorsystem Jian Masteractor.Akka's actor is a tree-shaped structure that can be used to find actors that are distributed across multiple machines, as well as to inherit some of the configuration to sub-actors.The Masteractor is the receiving and forwarding side of the message.Actorsystem run out to shutdown.650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/0C/wKioL1Xy6jLg3na0AAHWtddXN6k639.jpg "title=" Akka_ Practice.png "alt=" Wkiol1xy6jlg3na0aahwtddxn6k639.jpg "/>DT Big Data Dream
Label:Train Spark architecture Development!from basic to Advanced, one to one Training! [Technical qq:2937765541]--------------------------------------------------------------------------------------------------------------- ------------------------Course System:Get video material and training answer technical support addressCourse Presentation ( Big Data technology is very wide, has been online for you training solutions!) ):Get video material and training answer technical support addressSpa
How to package into a jar package:File, Project structure, artfact, point +, JAR, from modules with dependencies ...Select Module----click OK to specify main class.DT Big Data Dream Factory public account: Dt_spark.DT Big Data Dream Factory's public number is Dt_spark, every day will have big data actual combat video release, please continue to study.Liaoliang DT Big Data dream factory Scala all videos, PPT and code in Baidu Cloud disk link:http://pan
Masteractor the way to initialize Mapactor,reduceactor,aggregateactor.DT Big Data Dream Factory public account: Dt_spark.DT Big Data Dream Factory's public number is Dt_spark, every day will have big data actual combat video release, please continue to study.Liaoliang DT Big Data dream factory Scala all videos, PPT and code in Baidu Cloud disk link:http://pan.baidu.com/share/home?uk=4013289088#category/type=0 Qq-pf-to=pcqq.groupQQ Group:DT Big Data Dr
, doing what he's best at.failure handling of actorNo one is perfect, the actor is impossible. 100% complete a task if the task fails, an actor suspends himself and his subordinates, and then sends a message telling his superiors that "I failed". When a supervisor receives a "failed" message from a subordinate, it can react as follows: Failure fails, so it's not too much of a relationship: keep the current state, resume the actor, continue working not successful Ah, then redo it again: Reset th
For a, B, and C, the Akka is automatically executed sequentially by default, but for database operations we want to execute a few operations in order, and we need to use syntax to declareThere are two ways to declare a future relationship, the first is FlatMap, and the second is forImportScala.Concurrent.FutureImportScala.Concurrent.ExecutionContext.Implicits.GlobalImportScala.Concurrent.BlockingImportScala.Concurrent.Duration._DefF(Item: Int): Future
This blog gradually analyze the source of Akka streams, of course, must be gradual, and estimates will be divided into many, after all, Akka streams is more complex.
Implicit val system = Actorsystem ("QuickStart") implicit val Materializer = Actormaterializer ()
When using streams-related APIs, the above two objects must be created. Actorsystem no longer said, we came to see Actormaterializer.
Actormateri
A period of time has been immersed in functional programming mode, one of the main purposes is to master a set of safe and reliable concurrent programming method (concurrent programming), finally through the Open source project Funda implementation of the single-machine multi-core CPU program parallel operation. However, although the parallel operation in the terminal can make full use of the computing power of multi-core CPU to distribute data processing operations to the foreground can greatly
Scala has been using Akka as a concurrency model since 2.10, and this article is the first example of Akka.1.Akka Getting Started instance PackageCom.tv189.actorImportAkka.actor. {Actor, Actorsystem, Props}/*** Created by Molyeo on 2015/8/6.*/Object AkkaTest01extendsApp {val system= Actorsystem ("Akkatest") Val Helloac
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.