Actors in Scala by Philipp Haller

By Philipp Haller

Contemporary developments in desktop structure make concurrency and parallelism a vital component of effective application execution. The actor version of concurrency lets you exhibit real-world concurrency in a average approach utilizing concurrent tactics that converse through asynchronous messages.

Scala is a programming language for the Java digital laptop, supplying first-class help for either object-oriented and practical programming. by way of together with a strong actor framework in its ordinary library, Scala bargains a compelling method of take on concurrent programming. Scala's actors allow you to follow the actor concurrency version to the JVM, allowing real-world recommendations which are effective, scalable, and powerful.

Published via Artima, this is often the 1st booklet on Scala's actors, co-authored by way of the author and lead maintainer, Philipp Haller, and Frank Sommers. beginning with the basics of the actor concurrency version, this booklet deals a complete educational on functional programming with actors in Scala. It helps you to leverage the total energy of cutting-edge and tomorrow's multi-core processors through describing either easy and complex gains of Scala's actor framework in-depth.

Show description

Read or Download Actors in Scala PDF

Best software development books

Swift Apprentice

The way to software with speedy 2!
This is a publication for whole newbies to Apple’s fresh programming language – quick 2.

Everything will be performed in a playground, so that you can remain excited by the center rapid 2 language ideas like sessions, protocols, and generics.

This is a sister publication to the iOS Apprentice; the iOS Apprentice specializes in making apps, whereas the quick Apprentice makes a speciality of the quick 2 language itself.

Comparing and Merging Files with GNU diff and patch

This handbook describes find out how to examine and merge documents utilizing GNU diff and patch. evaluating and merging records is a typical job for software program builders. those courses make it effortless to discover and practice adjustments. GNU diff is a part of the GNU diffutils package deal, an entire set of courses for dealing with alterations among teams of documents.

Appium Essentials

Discover cellular automation with Appium and observe new how one can try local, net, and hybrid functions approximately This BookUse Appium to automate any form of cellular software from any language utilizing any attempt frameworkWrite a unmarried script to accomplish automation trying out on either Android and iOS platformsEquip your self with the sensible talents required to boost cellular functions utilizing this pragmatic guideWho This booklet Is ForThis booklet is meant for automation testers and builders who are looking to increase their abilities from web-based automation to cellular program automation utilizing Appium.

Comparable Corpora and Computer-assisted Translation

Computer-assisted translation (CAT) has constantly used translation stories, which require the translator to have a corpus of prior translations that the CAT software program can use to generate bilingual lexicons. this is difficult while the translator doesn't have any such corpus, for example, whilst the textual content belongs to an rising box.

Additional resources for Actors in Scala

Example text

Late binding in actor control flow is also an important tool in lending robustness to an actor-based system. For instance, an actor may be redundantly defined, allowing a message sender to send replicated messages. 7 · A more modular approach to cruise control with further decomposition of responsibilities into actors. 8 · A continuation actor included in a message affects control flow and accommodates late binding in an actor system. If actors interacting via messages sounds similar to how objects communicate in an object-oriented system, that likeness is no mere coincidence.

The following sections explore how to program with event-based actors effectively. Using r❡❛❝t effectively As we mentioned above, with r❡❛❝t an actor waits for a message in an event-based manner: Under the hood, instead of blocking the underlying worker thread, r❡❛❝t’s block of pattern-action pairs is registered as an eventhandler. That event handler is then invoked by the actor runtime when a matching message arrives. The event-handler is all that is retained before the actor goes to sleep. In particular, the call stack, as it is maintained by the current thread, is discarded when the actor suspends.

The body might as well be extracted to a method—❧♦♦♣❲❤✐❧❡ works in either case. 3 Event-based futures In Chapter 4, we illustrated how to use futures for result-bearing messages. Some of the methods to wait for the result of a future rely on the threadbased r❡❝❡✐✈❡ under the hood. While waiting for the result, those methods monopolize the underlying worker thread. It is also possible to wait for a future in an event-based way with r❡❛❝t. For example, suppose we would like to render a summary of all images linked from a web page at a given URL.

Download PDF sample

Rated 4.11 of 5 – based on 40 votes