SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
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!

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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.
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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.pdfsudhanshuwaghmare1
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
🐬 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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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 productivityPrincipled Technologies
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
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
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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...
 
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
 

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