SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
BY MICHEL PEREZ
ELIXIR & PARALLEL PROGRAMMING
CONCURRENCY VS PARALLELISM
ELIXIR MECHANISMS
▸ PROCESS
▸ SPAWNING
▸ OTP
▸ GEN SERVER
▸ SUPERVISOR
▸ APPLICATION
PROCESSES
▸ Processes are the fundamental unit of concurrency in Elixir
▸ The Erlang VM supports up to 134 million of processes
▸ Lightweight processes
▸ Each actor is a process
▸ Each process performs a specific task
▸ Sends messages to communicate with the process
▸ The processes don’t share information
SPAWNING A PROCESS
PID
▸ Identifies a process in the EVM
▸ To send a message must point the pid
OTP
▸ The Erlang interpreter and compiler
▸ Erlang standard libraries
▸ Dialyzer, a static analysis tool
▸ Mnesia, a distributed database
▸ Erlang Term Storage (ETS), an in-memory database
▸ A debugger,
▸ An event tracer
▸ A release management tool
OTP BEHAVIOURS
▸ GenServer A behaviour module for implementing the
server of a client-server relation.
▸ Supervisor A behaviour module for implementing
supervision functionality
▸ Application A module for working with applications and
defining application callbacks.
GEN SERVER - MODULE CALLS
▸ GenServer.start_link/3
▸ GenServer.call/3
▸ GenServer.cast/2
GEN SERVER - CALLBACKS
▸ init(args)
▸ handle_call(msg, {from, ref}, state}
▸ handle_cast(msg, state}
▸ handle_info(msg, state)
▸ terminate(reason, state)
▸ code_change(old_vsn, state, extra)
GENSERVER - INIT
▸ init(args)
▸ {:ok, state}
▸ {:ok, state, timeout}
▸ :ignore
▸ {:stop, reason}
GENSERVER - HANDLE CALL
▸ handle_call(msg, {from, ref},state)
▸ {:reply, reply, state}
▸ {:reply, reply, state, timeout}
▸ {:reply, reply, state, :hibernate}
▸ {:noreply, state}
▸ {:noreply, state, timeout}
▸ {:noreply, state, hibernate}
▸ {:stop, reason, reply, state}
▸ {:stop, reason, state}
GENSERVER - HANDLE CALL
▸ handle_cast(msg, state)
▸ {:noreply, state}
▸ {:noreply, state, timeout}
▸ {:noreply, state, :hibernate}
▸ {:stop, reason, state}
GENSERVER - HANDLE INFO - TERMINATE
▸ handle_info(msg, state)
▸ {:noreply, state}
▸ {:noreply, state, timeout}
▸ {:stop, reason, state}
▸ terminate(reason, state)
▸ :ok
GENSERVER - CODE CHANGE
▸ code_change(old_vsn, state, extra)
▸ {:ok, new_state}
▸ {:error, reason}
GENSERVER - EXAMPLE
SUPERVISOR
▸ Strategies
▸ :one_for_one
▸ :rest_for_one
▸ :one_for_all
▸ :simple_one_for_one
SUPERVISOR - EXAMPLE
APPLICATION
▸ Component implementing some specific functionality, that
can be started and stopped as a unit, and which can be re-
used in other systems
▸ Defines a supervision tree that must be started and
stopped when the application starts and stops
▸ The start callback should return {:ok, pid}
APPLICATION - EXAMPLE
EXTREME
B1N1 N2
N3
N4
F1 N5
EXSTREME - CREATING A GRAPH
EXSTREME - RUNNING THE GRAPH
EXSTREME - NOTES
▸ https://github.com/mrkaspa/Exstreme
▸ Future
▸ Add Backpresure (GenStage)
▸ Supervising
▸ Remote nodes
THANKS!

Más contenido relacionado

La actualidad más candente

Redis
RedisRedis
RedisPtico
 
The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196Mahmoud Samir Fayed
 
New text document
New text documentNew text document
New text documentTam Ngo
 
Metis - RubyConf 2011 Lightning Talk
Metis - RubyConf 2011 Lightning TalkMetis - RubyConf 2011 Lightning Talk
Metis - RubyConf 2011 Lightning TalkKen Robertson
 
Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observablesStefan Charsley
 
The Ring programming language version 1.6 book - Part 13 of 189
The Ring programming language version 1.6 book - Part 13 of 189The Ring programming language version 1.6 book - Part 13 of 189
The Ring programming language version 1.6 book - Part 13 of 189Mahmoud Samir Fayed
 

La actualidad más candente (6)

Redis
RedisRedis
Redis
 
The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196The Ring programming language version 1.7 book - Part 14 of 196
The Ring programming language version 1.7 book - Part 14 of 196
 
New text document
New text documentNew text document
New text document
 
Metis - RubyConf 2011 Lightning Talk
Metis - RubyConf 2011 Lightning TalkMetis - RubyConf 2011 Lightning Talk
Metis - RubyConf 2011 Lightning Talk
 
Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observables
 
The Ring programming language version 1.6 book - Part 13 of 189
The Ring programming language version 1.6 book - Part 13 of 189The Ring programming language version 1.6 book - Part 13 of 189
The Ring programming language version 1.6 book - Part 13 of 189
 

Destacado

Info-competencias para procesos de aprendizaje e investigación
Info-competencias  para  procesos de aprendizaje e investigaciónInfo-competencias  para  procesos de aprendizaje e investigación
Info-competencias para procesos de aprendizaje e investigaciónJesus Lau
 
Evolving Approaches to Measuring the Value of New Health Technologies in the US
Evolving Approaches to Measuring the Value of New Health Technologies in the USEvolving Approaches to Measuring the Value of New Health Technologies in the US
Evolving Approaches to Measuring the Value of New Health Technologies in the USOffice of Health Economics
 
WMCA Thrive Full Report
WMCA Thrive Full ReportWMCA Thrive Full Report
WMCA Thrive Full ReportSteve Appleton
 
Learning Outcome Two (Presentation)
Learning Outcome Two (Presentation)Learning Outcome Two (Presentation)
Learning Outcome Two (Presentation)phele1994
 
Shooting script football
Shooting script   football Shooting script   football
Shooting script football emilyhales123
 
FAL Financial Services Incorporated
FAL Financial Services IncorporatedFAL Financial Services Incorporated
FAL Financial Services IncorporatedKaren Haasbroek
 
10 things to do on instagram
10 things to do on instagram10 things to do on instagram
10 things to do on instagramAnthony Greene
 
Situación de las relaciones laborales en las bibliotecas mexicanas
Situación de las relaciones laborales en las bibliotecas mexicanasSituación de las relaciones laborales en las bibliotecas mexicanas
Situación de las relaciones laborales en las bibliotecas mexicanasJesus Lau
 
Bob’s discount furniture and the american red cross team up
Bob’s discount furniture and the american red cross team upBob’s discount furniture and the american red cross team up
Bob’s discount furniture and the american red cross team upBob Smith
 
Certified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXD
Certified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXDCertified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXD
Certified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXDKarnik Sangani
 
평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥
평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥
평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥zfzep34fb
 
Guapi. información del micrositio copia
Guapi. información del micrositio   copiaGuapi. información del micrositio   copia
Guapi. información del micrositio copiamarimba de chonta
 
Unidad 4 Las nuevas tecnologías.
Unidad 4 Las nuevas tecnologías.Unidad 4 Las nuevas tecnologías.
Unidad 4 Las nuevas tecnologías.Risbellis
 

Destacado (20)

Info-competencias para procesos de aprendizaje e investigación
Info-competencias  para  procesos de aprendizaje e investigaciónInfo-competencias  para  procesos de aprendizaje e investigación
Info-competencias para procesos de aprendizaje e investigación
 
Evolving Approaches to Measuring the Value of New Health Technologies in the US
Evolving Approaches to Measuring the Value of New Health Technologies in the USEvolving Approaches to Measuring the Value of New Health Technologies in the US
Evolving Approaches to Measuring the Value of New Health Technologies in the US
 
WMCA Thrive Full Report
WMCA Thrive Full ReportWMCA Thrive Full Report
WMCA Thrive Full Report
 
Offset y punta seca
Offset y punta secaOffset y punta seca
Offset y punta seca
 
Javier Hergenreter
Javier HergenreterJavier Hergenreter
Javier Hergenreter
 
Learning Outcome Two (Presentation)
Learning Outcome Two (Presentation)Learning Outcome Two (Presentation)
Learning Outcome Two (Presentation)
 
Shooting script football
Shooting script   football Shooting script   football
Shooting script football
 
FAL Financial Services Incorporated
FAL Financial Services IncorporatedFAL Financial Services Incorporated
FAL Financial Services Incorporated
 
Week1 lec1-bscs1
Week1 lec1-bscs1Week1 lec1-bscs1
Week1 lec1-bscs1
 
Shooting Script
Shooting ScriptShooting Script
Shooting Script
 
10 things to do on instagram
10 things to do on instagram10 things to do on instagram
10 things to do on instagram
 
Situación de las relaciones laborales en las bibliotecas mexicanas
Situación de las relaciones laborales en las bibliotecas mexicanasSituación de las relaciones laborales en las bibliotecas mexicanas
Situación de las relaciones laborales en las bibliotecas mexicanas
 
L5
L5L5
L5
 
Bob’s discount furniture and the american red cross team up
Bob’s discount furniture and the american red cross team upBob’s discount furniture and the american red cross team up
Bob’s discount furniture and the american red cross team up
 
Investigacion
InvestigacionInvestigacion
Investigacion
 
Certified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXD
Certified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXDCertified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXD
Certified _ Digital IC Design Using SystemVerilog_UC-ZZCTISXD
 
평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥
평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥
평촌오피,일산오피방 위치「OpHoLic5.Com」 세종오피 영통유흥
 
Copaso
CopasoCopaso
Copaso
 
Guapi. información del micrositio copia
Guapi. información del micrositio   copiaGuapi. información del micrositio   copia
Guapi. información del micrositio copia
 
Unidad 4 Las nuevas tecnologías.
Unidad 4 Las nuevas tecnologías.Unidad 4 Las nuevas tecnologías.
Unidad 4 Las nuevas tecnologías.
 

Similar a Elixir par

Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Odoo
 
Async Messaging in CQRS: Part 2 - Akka.NET
Async Messaging in CQRS: Part 2 - Akka.NETAsync Messaging in CQRS: Part 2 - Akka.NET
Async Messaging in CQRS: Part 2 - Akka.NETGeorge Tourkas
 
Discussion of NGRX-Entity
Discussion of NGRX-EntityDiscussion of NGRX-Entity
Discussion of NGRX-EntityNate Kidwell
 
Optimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedOptimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedViktor Sovietov
 
Async Messaging in CQRS: Part 1 - Masstransit + DDD Intro
Async Messaging in CQRS: Part 1 - Masstransit + DDD IntroAsync Messaging in CQRS: Part 1 - Masstransit + DDD Intro
Async Messaging in CQRS: Part 1 - Masstransit + DDD IntroGeorge Tourkas
 

Similar a Elixir par (8)

Elixir concurrency 101
Elixir concurrency 101Elixir concurrency 101
Elixir concurrency 101
 
Elixir talk
Elixir talkElixir talk
Elixir talk
 
Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...Tips on how to improve the performance of your custom modules for high volume...
Tips on how to improve the performance of your custom modules for high volume...
 
Async Messaging in CQRS: Part 2 - Akka.NET
Async Messaging in CQRS: Part 2 - Akka.NETAsync Messaging in CQRS: Part 2 - Akka.NET
Async Messaging in CQRS: Part 2 - Akka.NET
 
Discussion of NGRX-Entity
Discussion of NGRX-EntityDiscussion of NGRX-Entity
Discussion of NGRX-Entity
 
Optimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedOptimizing Erlang Code for Speed
Optimizing Erlang Code for Speed
 
Async Messaging in CQRS: Part 1 - Masstransit + DDD Intro
Async Messaging in CQRS: Part 1 - Masstransit + DDD IntroAsync Messaging in CQRS: Part 1 - Masstransit + DDD Intro
Async Messaging in CQRS: Part 1 - Masstransit + DDD Intro
 
Egearmand: an Erlang Gearman daemon
Egearmand: an Erlang Gearman daemonEgearmand: an Erlang Gearman daemon
Egearmand: an Erlang Gearman daemon
 

Último

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...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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 SolutionsEnterprise Knowledge
 
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 WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 FresherRemote DBA Services
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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...Neo4j
 
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.pdfEnterprise Knowledge
 

Último (20)

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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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...
 
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
 

Elixir par

  • 1. BY MICHEL PEREZ ELIXIR & PARALLEL PROGRAMMING
  • 3. ELIXIR MECHANISMS ▸ PROCESS ▸ SPAWNING ▸ OTP ▸ GEN SERVER ▸ SUPERVISOR ▸ APPLICATION
  • 4. PROCESSES ▸ Processes are the fundamental unit of concurrency in Elixir ▸ The Erlang VM supports up to 134 million of processes ▸ Lightweight processes ▸ Each actor is a process ▸ Each process performs a specific task ▸ Sends messages to communicate with the process ▸ The processes don’t share information
  • 6. PID ▸ Identifies a process in the EVM ▸ To send a message must point the pid
  • 7. OTP ▸ The Erlang interpreter and compiler ▸ Erlang standard libraries ▸ Dialyzer, a static analysis tool ▸ Mnesia, a distributed database ▸ Erlang Term Storage (ETS), an in-memory database ▸ A debugger, ▸ An event tracer ▸ A release management tool
  • 8. OTP BEHAVIOURS ▸ GenServer A behaviour module for implementing the server of a client-server relation. ▸ Supervisor A behaviour module for implementing supervision functionality ▸ Application A module for working with applications and defining application callbacks.
  • 9. GEN SERVER - MODULE CALLS ▸ GenServer.start_link/3 ▸ GenServer.call/3 ▸ GenServer.cast/2
  • 10. GEN SERVER - CALLBACKS ▸ init(args) ▸ handle_call(msg, {from, ref}, state} ▸ handle_cast(msg, state} ▸ handle_info(msg, state) ▸ terminate(reason, state) ▸ code_change(old_vsn, state, extra)
  • 11. GENSERVER - INIT ▸ init(args) ▸ {:ok, state} ▸ {:ok, state, timeout} ▸ :ignore ▸ {:stop, reason}
  • 12. GENSERVER - HANDLE CALL ▸ handle_call(msg, {from, ref},state) ▸ {:reply, reply, state} ▸ {:reply, reply, state, timeout} ▸ {:reply, reply, state, :hibernate} ▸ {:noreply, state} ▸ {:noreply, state, timeout} ▸ {:noreply, state, hibernate} ▸ {:stop, reason, reply, state} ▸ {:stop, reason, state}
  • 13. GENSERVER - HANDLE CALL ▸ handle_cast(msg, state) ▸ {:noreply, state} ▸ {:noreply, state, timeout} ▸ {:noreply, state, :hibernate} ▸ {:stop, reason, state}
  • 14. GENSERVER - HANDLE INFO - TERMINATE ▸ handle_info(msg, state) ▸ {:noreply, state} ▸ {:noreply, state, timeout} ▸ {:stop, reason, state} ▸ terminate(reason, state) ▸ :ok
  • 15. GENSERVER - CODE CHANGE ▸ code_change(old_vsn, state, extra) ▸ {:ok, new_state} ▸ {:error, reason}
  • 17. SUPERVISOR ▸ Strategies ▸ :one_for_one ▸ :rest_for_one ▸ :one_for_all ▸ :simple_one_for_one
  • 19. APPLICATION ▸ Component implementing some specific functionality, that can be started and stopped as a unit, and which can be re- used in other systems ▸ Defines a supervision tree that must be started and stopped when the application starts and stops ▸ The start callback should return {:ok, pid}
  • 23. EXSTREME - RUNNING THE GRAPH
  • 24. EXSTREME - NOTES ▸ https://github.com/mrkaspa/Exstreme ▸ Future ▸ Add Backpresure (GenStage) ▸ Supervising ▸ Remote nodes