Home Page Icon
Home Page
Table of Contents for
Effective Akka
Close
Effective Akka
by Jamie Allen
Effective Akka
Preface
Who This Book Is For
What Problems Are We Solving with Akka?
Distributed
Asynchronous
High Performance
Reactive Applications
Use Case for This Book: Banking Service for Account Data
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
1. Actor Application Types
Domain-driven
Domain-driven Messages Are “Facts”
Work Distribution
Routers and Routees
Random
Round robin
Smallest mailbox
Broadcast
ScatterGatherFirstCompletedOf
Consistent hash routing
BalancingDispatcher Will Be Deprecated Soon!
Work Distribution Messages Are “Commands”
2. Patterns of Actor Usage
The Extra Pattern
The Problem
Avoiding Ask
Capturing Context
Sending Yourself a Timeout Message
Why not use a promise?
How to test this logic
The Cameo Pattern
The Companion Object Factory Method
How to Test This Logic
3. Best Practices
Actors Should Do Only One Thing
Single Responsibility Principle
Create Specific Supervisors
Keep the Error Kernel Simple
Failure Zones
Avoid Blocking
Futures Delegation Example
Java futures are blocking!
Pre-defining Parallel Futures
Parallel Futures with the zip() Method
Sequential Futures
Callbacks versus Monadic Handling
Futures and ExecutionContext
Push, Don’t Pull
When You Must Block
Managed Blocking in Scala
Avoid Premature Optimization
Start Simple
Deterministic
Declarative
Immutable
Functional
Layer in Complexity via Indeterminism
Optimize with Mutability
Add mutability with compare and swap (CAS)
Compose CAS with Software Transactional Memory
Add locks as a last resort
Prepare for Race Conditions
Avoid coding in a way where timing matters
Tell, don’t ask
Be Explicit
Name Actors and ActorSystem Instances
Create Specialized Messages
Create Specialized Exceptions
Beware the “Thundering Herd”
Dampen message overload
Use circuit breakers for failure overload
Don’t Expose Actors
Avoid Using this
The Companion Object Factory Method
Never Use Direct References
Don’t Close Over Variables
Use Immutable Messages with Immutable Data
Help Yourself in Production
Make Debugging Easier
Add Metrics
Externalize Business Logic
Use Semantically Useful Logging
Aggregate Your Logs with a Tool Like Flume
Use Unique IDs for Messages
Tune Akka Applications with the Typesafe Console
Fixing Starvation
How do you fix it?
Does PinnedDispatcher help?
Failure zones
Routers
Sizing Dispatchers
The Parallelism-Factor Setting
Actor Mailbox Size
Throughput Setting
Edge Cases
About the Author
Colophon
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Preface
Effective Akka
Jamie Allen
Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset