According to my understanding, it does not, there are 2 ways to create an actor which is by either extending the Actor class and implementing receive or by creating an anonymous Actor using one of the actor methods. So far so good.
Akka has a concept of dispatchers (http://akka.io/docs/akka/1.1.3/scala/dispatchers.html), so does that mean that once I create an actor and implement the receive, by default I get the event dispatcher which is similar to the react in Scala? Of course, if i need to tie my actor to the thread of the OS then I would be using the thread based dispatcher, is this similar to receive in Scala?
An Akka MessageDispatcher is what makes Akka Actors “tick”, it is the engine of the machine so to speak. All MessageDispatcher implementations are also an ExecutionContext , which means that they can be used to execute arbitrary code, for instance Future s .
The thread pool executor dispatcher is implemented using by a java. util. concurrent. ThreadPoolExecutor .
Akka is a very scalable piece of software, not only in the context of performance but also in the size of applications it is useful for. The core of Akka, akka-actor, is very small and easily dropped into an existing project where you need asynchronicity and lockless concurrency without hassle.
Behind the scenes, Akka runs actors on real threads and many actors may share one thread. A Actor can create many actors called child actors. Actors interact only through asynchronous messages and never through direct method calls.
Akka has a concept of dispatchers (http://akka.io/docs/akka/1.1.3/scala/dispatchers.html), so does that mean that once I create an actor and implement the receive, by default I get the event dispatcher which is similar to the react in Scala?
Yes.
Of course, if i need to tie my actor to the thread of the OS then I would be using the thread based dispatcher, is this similar to receive in Scala?
Yes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With