SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Downloaden Sie, um offline zu lesen
AKKAWriting 'SCALA' ble & concurrent code
CHENSE meetup , Aug 24 2013
AGENDA
What is a concurrent system?
Paradigm
AKKA / Actors
My First Akka Code & Code walk through
Where & How could I use Akka?
Q&A
WHAT IS A CONCURRENT
SYSTEM?
"Concurrency solves the problem of having
scarce CPU resources and many tasks. So,
you create threads or independent paths
of execution through code in order to
share time on the scarce resource"
WHAT IS A CONCURRENT
SYSTEM ? (CONTD.)
capable of doing as many tasks but only one task at a time
like our mind - human mind capability is infinite but we can do at most one task at a time
handle thread lock and manage resources very efficiently
great for writing scalable application
EXAMPLE - "GOPHER'S BURNING PROBLEM" W/O
CONCURRENCY
EXAMPLE - HELPING GOPHERS WITH CONCURRENCY
Note : Multiple Gophers => Multicore CPU
PARADIGM
actor - a concurrent abstraction much like our human
mind
actors over threads to handle concurrency
communicate through message passing (async/ sync)
let actors decide what task to pick up at any instant of
time (take a deep breath)
ACTORS <=> AKKA
lightweight objects which handle message via case
classes in Scala
use pattern matching to receive msgs
async in nature
CODE KATA - MY FIRST
ACTOR
class Greeter extends Actor {
var greeting = ""
def receive = {
case WhoToGreet(who) => {
greeting = s"hello, $who"
println(greeting)
}
}
}
CODE KATA - WRITING
AKKA CLIENT
object HelloAkkaScala extends App {
// Create the 'helloakka' actor system
val system = ActorSystem("helloakka")
// Create the 'greeter' actor
val greeter = system.actorOf(Props[Greeter], "greeter")
greeter.!(WhoToGreet("first message"))
system.shutdown()
}
LET'S GET REAL !!!
WHERE & HOW COULD I
USE AKKA ?
concurrent applications
modeling concurrency
clustered message processing
Q & A
SESSION WHERE ABOUTS
Source :- https://github.com/prassee/hello-akka
Chense G+ page
https://plus.google.com/communities/10010288600516114105
-> THANKS <-

Weitere Àhnliche Inhalte

Ähnlich wie Introduction to akka chense

The Pillars Of Concurrency
The Pillars Of ConcurrencyThe Pillars Of Concurrency
The Pillars Of Concurrency
aviade
 
Ruby Concurrency
Ruby ConcurrencyRuby Concurrency
Ruby Concurrency
Egor Hamaliy
 

Ähnlich wie Introduction to akka chense (20)

Actors, Fault tolerance and OTP
Actors, Fault tolerance and OTPActors, Fault tolerance and OTP
Actors, Fault tolerance and OTP
 
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
Un actor (model) per amico - Alessandro Melchiori - Codemotion Milan 2016
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
 
Luigi lauro thread with care (concurrency pitfalls in java)
Luigi lauro   thread with care (concurrency pitfalls in java)Luigi lauro   thread with care (concurrency pitfalls in java)
Luigi lauro thread with care (concurrency pitfalls in java)
 
Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]
Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]
Thread with care: concurrency pitfalls in Java [Iași CodeCamp 25th October 2014]
 
The Pillars Of Concurrency
The Pillars Of ConcurrencyThe Pillars Of Concurrency
The Pillars Of Concurrency
 
The C10k Problem
The C10k ProblemThe C10k Problem
The C10k Problem
 
Refactoring Applications for the XK7 and Future Hybrid Architectures
Refactoring Applications for the XK7 and Future Hybrid ArchitecturesRefactoring Applications for the XK7 and Future Hybrid Architectures
Refactoring Applications for the XK7 and Future Hybrid Architectures
 
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded SoftwareBeyond the RTOS: A Better Way to Design Real-Time Embedded Software
Beyond the RTOS: A Better Way to Design Real-Time Embedded Software
 
Ruby Concurrency
Ruby ConcurrencyRuby Concurrency
Ruby Concurrency
 
Microservices in Clojure
Microservices in ClojureMicroservices in Clojure
Microservices in Clojure
 
Sharing-akka-pub
Sharing-akka-pubSharing-akka-pub
Sharing-akka-pub
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Threads
ThreadsThreads
Threads
 
How to build an HA container orchestrator infrastructure for production – Giu...
How to build an HA container orchestrator infrastructure for production – Giu...How to build an HA container orchestrator infrastructure for production – Giu...
How to build an HA container orchestrator infrastructure for production – Giu...
 
Introducing Parallel Pixie Dust
Introducing Parallel Pixie DustIntroducing Parallel Pixie Dust
Introducing Parallel Pixie Dust
 
Java Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data StructuresJava Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data Structures
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 
Designing a reactive real-time data platform: Architecture and Infrastructure...
Designing a reactive real-time data platform: Architecture and Infrastructure...Designing a reactive real-time data platform: Architecture and Infrastructure...
Designing a reactive real-time data platform: Architecture and Infrastructure...
 

Mehr von PrasannaKumar Sathyanarayanan (8)

Akka fsm presentation
Akka fsm presentationAkka fsm presentation
Akka fsm presentation
 
Cps (continuation passing style) in scala
Cps (continuation passing style) in scalaCps (continuation passing style) in scala
Cps (continuation passing style) in scala
 
Finagle - an intro to rpc & a sync programming in jvm
Finagle - an intro to rpc & a sync programming in jvmFinagle - an intro to rpc & a sync programming in jvm
Finagle - an intro to rpc & a sync programming in jvm
 
Websocket,JSON in JEE7
Websocket,JSON in JEE7Websocket,JSON in JEE7
Websocket,JSON in JEE7
 
Scala Introduction with play - for my CSS nerds
Scala Introduction with play - for my CSS nerdsScala Introduction with play - for my CSS nerds
Scala Introduction with play - for my CSS nerds
 
Ejb3.1
Ejb3.1Ejb3.1
Ejb3.1
 
Producer consumerproblem
Producer consumerproblemProducer consumerproblem
Producer consumerproblem
 
Scala presentationjune112011
Scala presentationjune112011Scala presentationjune112011
Scala presentationjune112011
 

KĂŒrzlich hochgeladen

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

KĂŒrzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Introduction to akka chense

  • 1. AKKAWriting 'SCALA' ble & concurrent code CHENSE meetup , Aug 24 2013
  • 2. AGENDA What is a concurrent system? Paradigm AKKA / Actors My First Akka Code & Code walk through Where & How could I use Akka? Q&A
  • 3. WHAT IS A CONCURRENT SYSTEM? "Concurrency solves the problem of having scarce CPU resources and many tasks. So, you create threads or independent paths of execution through code in order to share time on the scarce resource"
  • 4. WHAT IS A CONCURRENT SYSTEM ? (CONTD.) capable of doing as many tasks but only one task at a time like our mind - human mind capability is infinite but we can do at most one task at a time handle thread lock and manage resources very efficiently great for writing scalable application
  • 5. EXAMPLE - "GOPHER'S BURNING PROBLEM" W/O CONCURRENCY
  • 6. EXAMPLE - HELPING GOPHERS WITH CONCURRENCY Note : Multiple Gophers => Multicore CPU
  • 7. PARADIGM actor - a concurrent abstraction much like our human mind actors over threads to handle concurrency communicate through message passing (async/ sync) let actors decide what task to pick up at any instant of time (take a deep breath)
  • 8. ACTORS <=> AKKA lightweight objects which handle message via case classes in Scala use pattern matching to receive msgs async in nature
  • 9. CODE KATA - MY FIRST ACTOR class Greeter extends Actor { var greeting = "" def receive = { case WhoToGreet(who) => { greeting = s"hello, $who" println(greeting) } } }
  • 10. CODE KATA - WRITING AKKA CLIENT object HelloAkkaScala extends App { // Create the 'helloakka' actor system val system = ActorSystem("helloakka") // Create the 'greeter' actor val greeter = system.actorOf(Props[Greeter], "greeter") greeter.!(WhoToGreet("first message")) system.shutdown() }
  • 12. WHERE & HOW COULD I USE AKKA ? concurrent applications modeling concurrency clustered message processing
  • 13. Q & A
  • 14. SESSION WHERE ABOUTS Source :- https://github.com/prassee/hello-akka Chense G+ page https://plus.google.com/communities/10010288600516114105 -> THANKS <-