WITH PIPES:
WITH PIPES + SYNTAX SUGAR!
Function Capture
Slide 41
Slide 41 text
A
Real World
EXAMPLE
OUTPUT:
Slide 42
Slide 42 text
A
Real World
EXAMPLE
Slide 43
Slide 43 text
A
Real World
EXAMPLE
Slide 44
Slide 44 text
A
Real World
EXAMPLE
Slide 45
Slide 45 text
A
Real World
EXAMPLE
Slide 46
Slide 46 text
A
Real World
EXAMPLE
Slide 47
Slide 47 text
No content
Slide 48
Slide 48 text
No content
Slide 49
Slide 49 text
Concurrency
model
Actor
Slide 50
Slide 50 text
1. is a Process
An Actor:
Slide 51
Slide 51 text
1. is a Process
2. performs a specific task
An Actor:
Slide 52
Slide 52 text
1. is a Process
2. performs a specific task
3. can send and receive a message
An Actor:
Slide 53
Slide 53 text
1. is a Process
2. performs a specific task
3. can send and receive a message
4. responds to specific types of
messages
An Actor:
Slide 54
Slide 54 text
1. is a Process
2. performs a specific task
3. can send and receive a message
4. responds to specific types of
messages
5. no shared memory with other
processes
An Actor:
Slide 55
Slide 55 text
processes
THE BASIC CONCURRENCY PRIMITIVE
Slide 56
Slide 56 text
This is a
Process
<0.88.0>
Slide 57
Slide 57 text
<0.88.0>
This is a
Process ID (pid)
Slide 58
Slide 58 text
a
Process
communicates
<0.81.0>
by
sending messages
<0.88.0>
send <0.81.0>, “OHAI”
Slide 59
Slide 59 text
a
Process
communicates
<0.81.0>
<0.88.0>
send <0.88.0>,“WASSAP”
and
receiving messages.
Coordinator Process
Hi, I am Coordinator.
n = 3
# = 0
Slide 112
Slide 112 text
No content
Slide 113
Slide 113 text
n = 3
# = 3
BASE CASE:
!
!
!
!
!
!
PROCESSED WORKERS == NUMBER OF WORKERS
SAME VALUE!
Slide 114
Slide 114 text
{:ok, 5000}
n = 3
# = 1
Slide 115
Slide 115 text
{:error,:timeout} n = 3
# = 1
Slide 116
Slide 116 text
Running
the program
Slide 117
Slide 117 text
Running
the program
Slide 118
Slide 118 text
TASKS
EXECUTING COMPUTATIONS ASYNCHRONOUSLY
Slide 119
Slide 119 text
Tasks
Example
Slide 120
Slide 120 text
Tasks
Example
Slide 121
Slide 121 text
Running
the program
n = 3
# = 0
Slide 122
Slide 122 text
Running
the program
n = 3
# = 0
worker
1
Slide 123
Slide 123 text
Running
the program
n = 3
# = 1
worker
2
Slide 124
Slide 124 text
Running
the program
n = 3
# = 2
worker
3
Slide 125
Slide 125 text
Running
the program
n = 3
# = 3
RESULT:
2 succeeded, 1 failure.
Slide 126
Slide 126 text
No content
Slide 127
Slide 127 text
A Concurrent
HTTP LOAD TESTER
Slide 128
Slide 128 text
Running
the program
Slide 129
Slide 129 text
Serial:
Concurrent:
Slide 130
Slide 130 text
Running
the program
n = 3
# = 0
worker
1
worker
2
worker
3
Slide 131
Slide 131 text
No content
Slide 132
Slide 132 text
A Distributed
HTTP LOAD TESTER
Slide 133
Slide 133 text
Erlang Runtime System Erlang Runtime System
A B C
send(B, Msg)
Network
Slide 134
Slide 134 text
Erlang Runtime System Erlang Runtime System
A B C
send(C, Msg)
Network
Slide 135
Slide 135 text
Running
the program
Slide 136
Slide 136 text
Running
the program
MASTER
Slide 137
Slide 137 text
Running
the program
MASTER SLAVE 1
SLAVE 2 SLAVE 3
Slide 138
Slide 138 text
Running
the program
Slide 139
Slide 139 text
Running
the program
Slide 140
Slide 140 text
Running
the program
Slide 141
Slide 141 text
Running
the program
Slide 142
Slide 142 text
No content
Slide 143
Slide 143 text
No content
Slide 144
Slide 144 text
Running
the program
Slide 145
Slide 145 text
Running
the program
Slide 146
Slide 146 text
No content
Slide 147
Slide 147 text
No content
Slide 148
Slide 148 text
No content
Slide 149
Slide 149 text
Chris McCord!
@chrismccord
Slide 150
Slide 150 text
http://www.elixirsips.com
Slide 151
Slide 151 text
No content
Slide 152
Slide 152 text
No content
Slide 153
Slide 153 text
http://benjamintanweihao.github.io
Slide 154
Slide 154 text
No content
Slide 155
Slide 155 text
Coming Soon-ish!
Slide 156
Slide 156 text
HEATHER MILLER for the slide designs I stole.
Credits
My HUI LING, for letting me ignore her.
http://misterjazzz.deviantart.com/art/Constructicons-with-Prowl-C-446618997
http://thisotplife.tumblr.com
http://battlefordreamisland.wikia.com/
Image Credits
Network by Brennan Novak from The Noun Project
Fork by Dmitry Baranovskiy from The Noun Project
Slide 157
Slide 157 text
Fin. Questions?
Thank you!
BENJAMIN TAN WEI HAO @BENTANWEIHAO