SlideShare a Scribd company logo
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!

More Related Content

What's hot

Redis
RedisRedis
Redis
Ptico
 
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
Mahmoud Samir Fayed
 
New text document
New text documentNew text document
New text document
Tam Ngo
 
Metis - RubyConf 2011 Lightning Talk
Metis - RubyConf 2011 Lightning TalkMetis - RubyConf 2011 Lightning Talk
Metis - RubyConf 2011 Lightning Talk
Ken Robertson
 
Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observables
Stefan 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 189
Mahmoud Samir Fayed
 

What's hot (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
 

Viewers also liked

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
Jesus 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 US
Office of Health Economics
 
WMCA Thrive Full Report
WMCA Thrive Full ReportWMCA Thrive Full Report
WMCA Thrive Full ReportSteve Appleton
 
Javier Hergenreter
Javier HergenreterJavier Hergenreter
Javier Hergenreter
mavirginiamarti
 
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
 
Week1 lec1-bscs1
Week1 lec1-bscs1Week1 lec1-bscs1
Week1 lec1-bscs1
syedhaiderraza
 
Shooting Script
Shooting ScriptShooting Script
Shooting Script
MelissaShearer
 
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 mexicanas
Jesus 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
 
Investigacion
InvestigacionInvestigacion
Investigacion
lalogabino
 
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 copia
marimba 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
 

Viewers also liked (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 to Elixir par

Elixir concurrency 101
Elixir concurrency 101Elixir concurrency 101
Elixir concurrency 101
Rafael Antonio Gutiérrez Turullols
 
Elixir talk
Elixir talkElixir talk
Elixir talk
Cory Gwin
 
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.NET
George Tourkas
 
Discussion of NGRX-Entity
Discussion of NGRX-EntityDiscussion of NGRX-Entity
Discussion of NGRX-Entity
Nate Kidwell
 
Optimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedOptimizing Erlang Code for Speed
Optimizing Erlang Code for Speed
Viktor 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 Intro
George Tourkas
 
Egearmand: an Erlang Gearman daemon
Egearmand: an Erlang Gearman daemonEgearmand: an Erlang Gearman daemon
Egearmand: an Erlang Gearman daemon
Antonio Garrote Hernández
 

Similar to 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
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 

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