index

Symbols

! character 22, 25

? character 22, 25

[] operator 48

\ operator 30

& operator 104

&*/2 operator 103

&+/2 operator 103

&n placeholder 54

+ operator 103

++ operator 41

+P flag 367

+S 1 Erlang flag 171

<> operator 50

= 22, 79

> operators 49

|> (pipe operator) 114

~D sigil 58

~N sigil 59

~T sigil 59

~U sigil 59

A

abstraction

basic 114 – 116

composing 116 – 117

Access module 131

actor model 190

after clause 149

Agent API

agent-powered to-do server 276 – 277

concurrency and 274 – 276

ETS tables 280 – 283

Agent module 190, 254, 267, 273 – 275

basic use 273 – 274

Agent.cast/2 function 274

Agent.get/2 function 274

Agent.update/2 function 274

agents

concurrency and 274 – 276

limitations of 277 – 280

alias expression 31

aliases 36

anonymous functions 52 – 55

anonymous variable 72

Any alias 136

application callback, implementing 302 – 303

:application module 300

Application.ensure_all_started/2 function 300

Application.fetch_env!/2 function 322

Application.get_env/3 function 322

Application.start/1 function 300

Application.stop/1 function 301

application/0 function 301 – 302

applications

behavior 181, 299

configuring 321 – 322

creating with mix tool 298 – 299

environment 321

module 182, 300, 321

resource file 298

area clause 82

area(unknown) clause 82

arity 30

assert macro 199 – 200

AST (abstract syntax tree) 14

asynchronous requests 178 – 180

atoms 36 – 39

awaited tasks 268 – 270

B

:bag table type 284

BEAM (Bogdan/Björn’s Erlang Abstract Machine) 5

Bench module 286, 289

Bench.run function 282

binaries 49 – 50, 75

bitstrings 49 – 50, 75

boilerplate, eliminating 12 – 15

Boolean atoms 37

branching expressions 88 – 91

C

cache, implementing 195 – 198

:calendar.local_time/0 function 70, 78

call requests 178

callback module 175

using with supervisors 233 – 234

caller variable 151

calls 319

capture operator 54, 101, 117

case expression 20, 90, 148, 220

cast requests 178

casts 319

checkin operation 307

checkout operation 307

child specification 230

child_spec/1 function 271

clause definition 80

cli function 362

closure 55

clusters, building fault-tolerant

detecting partitions 348 – 349

discovering to-do servers 338 – 343

testing 346 – 347

to-do cache 338 – 343

code organization 23 – 25

comments 34 – 35

function visibility 30 – 31

functions 25 – 28

code simplification 12 – 15

:code.get_path Erlang function 64

collectable 105

Collectable protocol 137

command variable 77

comments 34 – 35

communication between nodes 329 – 331

compiling, for production 360 – 361

components

config script considerations 324

configuring applications 321 – 322

dependencies 306 – 307

visualizing systems 310 – 311

dependency injection, adapting pool 307 – 310

OTP applications

application behavior 299 – 300

creating with mix tool 298 – 299

folder structure 304 – 306

implementing application callback 302 – 303

library applications 301

web server

handling requests 314 – 317

starting server 312 – 314

composing abstractions 116 – 117

comprehensions 104 – 106

concurrency 4 – 7, 141 – 172, 192

agents and 274 – 276

building concurrent systems

addressing process bottleneck 209 – 211

persistence 202

errors in concurrent systems 221 – 223

ETS tables 280 – 283

multiple to-do lists 195

processes 213 – 214

creating 145 – 147

runtime considerations

shared-nothing concurrency 170

unlimited process mailboxes 169 – 170

schedulers, inner workings of 171 – 172

supervision trees, supervising database workers 250 – 253

to-do list example

analyzing process dependencies 201 – 202

implementing cache 195 – 198

writing tests 198 – 201

concurrency primitives

complex states 162 – 166

message passing 147 – 152

registered processes 166 – 167

stateful server processes 152 – 156

concurrent programming

multiple to-do lists 195

persisting data

analyzing system 207 – 209

pooling and synchronizing 212

using database 204 – 207

writing tests, to-do list example application 198 – 201

concurrent systems, building

persistence 202

persisting data

addressing process bottleneck 209 – 211

pooling and synchronizing 212

reasoning with processes 213 – 214

cond expression 89 – 90

conditionals 86 – 94

branching expressions 88 – 91

Config.config_env/0 function 323

Config.config/2 function 322

conn variable 316

constants, matching 71 – 72

control flow 69 – 111

conditionals 86 – 94

branching expressions 88 – 91

iterating, with recursion 95 – 96

loops and iterations 94 – 99

comprehensions 104 – 106

streams 106

tail function calls 96 – 99

matching with functions

guards 83 – 85

multiclause functions 80 – 82

multiclause lambdas 85 – 86

pattern matching

bitstrings and binaries 75 – 77

compound matches 77 – 78

constants 71 – 72

general behavior 78 – 80

matching maps 74 – 75

variables in patterns 72 – 73

--cookie option 351

cookies 351 – 352

Cowboy library 312

cprof tool 371

CRUD (create, read, update, delete) operations 126 – 128

current_sum parameter 98

D

daemon command 363

daemon_iex command 364

data abstractions 112 – 138

composing abstractions 116 – 117

CRUD operations 126 – 128

hierarchical data 126 – 134

immutable hierarchical updates 129 – 131

importing from file 133 – 134

iterative updates 131 – 132

updating entries 128 – 129

polymorphism with protocols 136

built-in protocols 137 – 138

implementing protocols 136 – 137

with modules

basic abstraction 114 – 116

structs 119 – 124

data transparency 124 – 126

data types, first-class functions 52 – 55

database processes 204 – 207

database workers, supervising 250 – 253

Date data structure 112

Date module 59, 115, 125

DateTime module 59, 125

@db_folder module attribute 204

dbg function 371

dbg macro 126, 371

:dbg module 375

debugger node 357

def expression 23, 25, 86, 88

def function 63

def macro 25, 30

default clause 82

defexception macro 221

defimpl macro 136

defmodule expression 23

defmodule function 63

defmodule macro 25

defp expression 86

defp macro 30

defrecord macro 123 – 124

defrecordp macro 123

defstruct macro 119

delete_entry request 165

dependencies 306 – 307

dependency injection, adapting pool 307 – 310

deps function 299, 373

-detached erlang flag 357

detached mode 357

development platform, Erlang 9 – 10

dirty scheduler thread 171

disadvantages of Elixir, Erlang ecosystem 17

distributed systems 325 – 354

distribution primitives

communicating between nodes 329 – 331

links and monitors 334 – 335

other distribution services 335 – 337

process discovery 334

fault-tolerant clusters 337 – 347

detecting partitions 348 – 349

discovering to-do servers 338 – 343

highly available systems 349 – 350

replicated databases 343 – 346

testing 346 – 347

to-do cache 338 – 343

network considerations

cookies 351 – 352

node names 350 – 351

primitives 327 – 329

do block 105, 199

do/end block 104, 136

@doc attribute 33

Docker containers, packaging releases in 367 – 369

:DOWN message 225

:duplicate_bag table type 284

DynamicSupervisor 272

DynamicSupervisor module 257

DynamicSupervisor.start_child/2 function 258

DynamicSupervisor.start_link/1 function 258

E

-e argument 281

each function 107

Elixir 3

code simplification 12 – 15

concurrency 141 – 172, 192

disadvantages of Erlang ecosystem 17

functions, composing 15 – 16

script 198

elixir application 306, 365

elixir command 66, 356 – 358

elixir my_script.exs command 358

Elixir, building blocks

code organization 23 – 35

comments 34 – 35

function visibility 30 – 31

functions 25 – 28

imports and aliases 31 – 32

module attributes 32 – 34

modules 23 – 25

macros 62 – 63

runtime 63 – 67

starting 65 – 67

type system 35 – 61

atoms 37 – 39

first-class functions 52 – 55

immutability 43 – 46

IO lists 60 – 61

lists 40 – 43

maps 46 – 49

numbers 35 – 36

tuples 39 – 40

variables, overview of 22 – 23

Enum functions 106 – 109, 122, 134

Enum module 40, 47, 58, 100, 104 – 105, 107, 134, 137, 289

Enum-based iterations 104

Enum.at/2 function 40, 156

Enum.each/2 function 53, 56, 100, 134, 146

Enum.filter/2 function 101 – 102, 109

Enum.map/2 function 100, 152

Enum.reduce/3 function 102, 106

Enum.sum/1 function 103

Enum.take/2 function 107 – 108

Enum.to_list function 107

Enum.to_list/1 function 107

Enum.with_index/1 function 106 – 107

Enumerable protocol 137

epmd -names command 353

EPMD (Erlang Port Mapper Daemon) 353

eprof tool 371

Erlang

concurrency 4 – 7

development platform 9 – 10

ecosystem 17

high availability 4 – 7

processes 5

relationship to microservices 10 – 11

server-side systems 7 – 9

:erlang.binary_to_term/1 function 203, 330

:erlang.memory/0 function 372

:erlang.system_info/1 function 372

:erlang.term_to_binary/1 function 203, 330

:erlang.trace/3 function 375

Erlang/OTP 9

error effects 239 – 266

error handling

concurrent systems 221 – 223

runtime errors 218 – 221

supervision trees

organizing 253 – 256

registering database workers 247 – 249

separating loosely dependent parts 240 – 243

error isolation approaches, dynamic supervision 257 – 258

error kernel 263

errors 216

:ets functions 287

:ets module 288

ETS operations 289

ETS tables 267, 280 – 283

basic operations 285

deleting rows 289 – 291

ETS powered key-value store 285 – 289

inserting rows 289 – 291

key-based lookups 289 – 291

overview of 280, 289 – 291

process registry 292 – 293

:ets.delete/2 function 288

:ets.insert/2 function 284, 288

:ets.lookup/2 function 284

:ets.new/2 function 284 – 285

:ets.select/2 function 290

:ets.update_counter/4 function 288

:ets.update_element/3 function 288

EtsKeyValue module 289

ex_doc tool 33

ex_unit framework 198

ex2ms library 290

exit reason 223

exit signal 223

exits 216

:extra_applications option 372

extract_user/1 function 92

F

falsy values 38

fault tolerance 142, 215 – 238

errors in concurrent systems, linking processes 223 – 225

handling errors in concurrent systems 225 – 226

runtime errors 216 – 221

handling 218 – 221

supervisors 226 – 227

child specifications 230 – 232

linking all processes 234 – 237

preparing existing code 227 – 228

restart frequency 237 – 238

using callback modules 233 – 234

wrapping 233

fetch_query_params function 316

File.mkdir_p!/1 function 204

File.read/1 function 72

File.stream!/1 function 109

files, importing from 133 – 134

filter function 107

flush helper 330

fn expression 52

fold function 102

folder structure, OTP applications 304 – 306

for:Type 136

fprof tool 371

fraction example 119

Fraction.new/2 function 124

Fraction.value/1 function 121

functions

anonymous 52 – 55

arity 30

composing 15 – 16

defined inside modules 23

first-class 52 – 55

higher-order 99 – 104

matching with

guards 83 – 85

multiclause functions 80 – 82

overview of 25 – 28

visibility 30 – 31

G

:"$gen_call" atom 185

:"$gen_cast" atom 185

gen_event behaviour 181

gen_server behaviour 181

:gen_server module 181

gen_statem behaviour 181

GenServer (generic server process) 153, 184, 225, 233, 245 – 246, 270

abstraction 338

behaviours 181 – 182

building

asynchronous requests 178 – 180

implementing generic code 175 – 176

refactoring to-do server using GenServer 180 – 181

callbacks 278

features of 186 – 189

functions 190

GenServer, plugging into 182 – 183

handling requests 183 – 184

loop 190

message handling, plain messages 184 – 186

module 181 – 183, 254 – 255, 267

Open Telecom Platform-compliant processes 190 – 191

OTP behaviours 181 – 182

plugging into 182 – 183

process life cycle 189 – 190

refactoring to-do server using 180 – 181

GenServer.abcast/3 function 331

GenServer.call 246

GenServer.call function 225

GenServer.call/2 function 183 – 184

GenServer.cast 246

GenServer.cast/2 function 183 – 184

GenServer.multi_call/4 function 331

GenServer.start invocation 206 – 207

GenServer.start_link function 260

GenServer.start/2 function 182 – 184, 197

GenServer.stop/3 function 189

GenStage library 190, 321

get_and_update_in/2 macro 131

get_in/2 macro 131

global module 331, 334

global.erl file 336

:global.trans/2 336

group leader 329

guards 83 – 85

H

h command 21

handle_* callbacks 190

handle_call/2 callback function 176 – 178

handle_call/3 callback function 183, 188 – 189, 278

handle_call/3 clause 186

handle_cast/2 callback function 179, 183, 186, 188, 278

handle_continue/2 callback function 206 – 207, 243

handle_info/2 callback function 185 – 186, 188, 278

hd function 42, 74

head | tail 87

Hébert, Fred 370

Heisenbug category 221

hex package 361

Hex package manager 16, 307

--hidden argument 352

hidden nodes 352 – 353

hidden tag 352

hierarchical data 126 – 134

immutable hierarchical updates 129 – 131

importing from file 133 – 134

iterative updates 131 – 132

updating entries 128 – 129

high availability 4 – 7

higher-level types 56 – 59

higher-order functions 99 – 104

highly available systems 349 – 350

HTTP servers, building 317

reasoning about system 317 – 321

I

id field 127

iex -S mix command 356

iex application 365

iex command 20

iex session 28, 247

iex shell 63, 163

iex shell prompt 222

if expression 20, 63, 86, 88 – 89

immutability 43 – 46

@impl attribute 187

@impl GenServer function 187

@impl module attribute 187

implementation functions 153

imports and aliases 31 – 32

in operator 41

inet_dist_listen_max environment variable 353

inet_dist_listen_min environment variable 353

__info__/1 function 182

init/0 function 175 – 176, 178

init/1 callback 183 – 184, 206, 228, 255, 286

inject function 102

inspect function 124, 137

Inspect protocol 137

Integer.to_string/1 function 136

intentional programming 263

interactive shell 20 – 21

interface functions 153, 178

into option 105

IO lists 60 – 61

IO module 23

IO.inspect 370

IO.inspect function 57, 212, 371

IO.inspect/1 function 125, 133

iterations

comprehensions 104 – 106

iterating with recursion 95 – 96

iterative updates 131 – 132

K

kernel app 353

:kernel application 336

kernel application 306, 365

Kernel module 31, 61

Kernel.apply/3 function 65

Kernel.defprotocol/2 function 137

Kernel.elem/2 function 39

Kernel.inspect/1 function 124

Kernel.is_number/1 function 84

Kernel.length/1 function 40

Kernel.node/0 function 327

Kernel.put_elem/3 function 39

Kernel.put_in/2 macro 130

Kernel.send/2 function 148

Kernel.to_string/1 function 135

key-based lookups 289 – 291

key-value stores 287

ETS powered 285 – 289

example, handling requests 183 – 184

keys 284

:keys option 244

keyword lists 56

Keyword module 57

Keyword.get/2 function 57

L

lambda functions 53

lambdas, multiclause 85 – 86

let-it-crash approach

handling expected errors 264 – 265

preserving state 265 – 266

library applications 301

linking processes 223 – 225

links and monitors 334 – 335

List module 40 – 41, 113

List.Chars protocol 137

List.first/1 function 113

List.insert_at/3 function 41, 113

List.replace_at/3 function 41

lists 40 – 43

matching 73 – 74

literals 170

local name 166

location transparency 329

logger application 370 – 371

logging 371 – 373

long names 327, 350

loops and iterations, tail function calls 96 – 99

M

m:n threading 171

macros 62 – 63

Map functions 123

Map module 49

Map.delete/2 function 47

Map.fetch!/2 function 47

Map.fetch/2 function 49, 129, 196

Map.get/3 function 47, 116

Map.has_key?/2 function 101

Map.new/1 function 46

Map.put/3 function 47, 49

Map.update function 129

Map.update/4 function 47, 115 – 116

maps 46 – 49

matching 74 – 75

MapSet module 58, 114

MapSet.new(...) output 124

match operator 70 – 71

match patterns 289

match specification 290

match-all anonymous variable 290

max function 89

maximum restart frequency 237

message passing 147 – 152

messages, handling plain 184 – 186

MFA (module, function, arguments) list 330

microservices, relationship to Erlang 10 – 11

mix archive.install task 360

mix command 67, 356 – 358

mix compile command 193, 307

mix deps.get command 307

mix environment 304, 323

compiling for production 360 – 361

mix escript.build documentation 360

mix project 163

mix release command 362

mix run command 281

mix tasks 371

mix test command 67, 303, 360

mix tool 16, 67, 193, 302, 312, 321, 355 – 356, 372

creating applications with 298 – 299

MIX_ENV environment variable 361

MIX_ENV OS environment variable 304

Mix.install function 359

modifier functions 113

module attributes 32 – 34

__MODULE__ form 188

@moduledoc attribute 33

modules 23

abstractions with 114

composing abstractions 116 – 117

data transparency 124 – 126

monitor_nodes function 349

monitors 225 – 226, 334 – 335

multicall function 345

multiclause functions 69, 80 – 82

multiclause lambdas 85 – 86

N

:name option 187, 244, 246, 308

:named_table option 285

:net_adm module 335

:net_adm.names/0 353

:net_kernel module 335

:net_kernel.monitor_nodes function 329

netsplit situations 348

--no-halt option 67, 356

--no-halt parameter 66

Node module 335

Node.connect/1 function 328

Node.get_cookie/0 function 351

Node.list([:this,:visible]) function 357

Node.list/0 function 328

Node.monitor/1 function 329

Node.monitor/2 function 349

Node.set_cookie/1 function 351

Node.set_cookie/2 function 352

Node.spawn 335

Node.spawn/2 function 329

Node.spawn/4 function 330

nodes

communicating between 329 – 331

hidden nodes 352 – 353

names 350 – 351

non-awaited tasks 270 – 272

numbers 35 – 36

O

observer application 372 – 373

observer tool 310

observer_cli 373

:one_for_all restart strategy 256

:one_for_one restart strategy 256

one_for_one strategy 229

Open Telecom Platform (OTP). See OTP

operators 48, 61 – 62

:ordered_set table type 284

organizing code

function arity 30

imports and aliases 31 – 32

module attributes 32 – 34

OTP (Open Telecom Platform) 9, 173

applications

behavior 299 – 300

folder structure 304 – 306

starting 300 – 301

behaviours 181 – 182

compliant processes 190 – 191

releases 361 – 369

contents of 364 – 367

packaging in Docker containers 367 – 369

using 363 – 364

P

parse transform construct 12

partition situation 338

partitions, detecting 348 – 349

pattern 70

pattern matching

bitstrings and binaries 75 – 77

compound matches 77 – 78

constants 71 – 72

general behavior 78 – 80

match operator 70 – 71

matching maps 74 – 75

variables in patterns 72 – 73

person variable 40, 70

pg (process groups) module 333

pg.erl file 336

Phoenix Framework 190, 312

Phoenix.Channel module 190

phx.new task 360

@pi constant 32

PIDs (process identifiers) 145

pin operator 73

pipe operator 28

plug

dispatch expression 315

match expression 315

Plug library 312

plug macro 315

Plug.Conn struct 316

Plug.Conn.fetch_query_params/1 function 316

Plug.Cowboy.child_spec/1 function 313

polymorphism, implementing protocols 136 – 137

Poolboy library 306

post macro 315 – 316

POST request 314

primitives, in distributed systems 327 – 329

process discovery 334

process identifiers (PIDs) 145

process life cycle 189 – 190

process mailboxes, unlimited 169 – 170

process registry 292 – 293

process_message/2 clause 165

process_message/2 function 161, 164

Process.exit/2 function 229

Process.info/1 function 372

Process.link/1 function 223

Process.list/0 function 198, 372

Process.sleep/1 function 169

processes 142

creating 145 – 147

finding to-do servers 259 – 260

linking 223 – 225

linking all 234 – 237

message passing 147 – 152

starting dynamically 256 – 257

testing system 261 – 262

using temporary restart strategy 260 – 261

:protected value 285

protocols 134

built-in 137 – 138

implementing 136 – 137

polymorphism with 136

pry feature 371

:public value 285

put operations 288

put request 179

put_elem function 39

put_in/3 macro 131

put/3 function 178

puts function 23

Q

query functions 113

query_def variable 146

R

raise/1 macro 217, 219

:rand.uniform/1 function 156

Range module 56

rebar package 361

receive clause 160

receive expression 63, 148, 220

Recon library 375

Record module 123

Record.extract/2 function 124

rectangle_area function 26

recursion 95 – 96

reduce function 102

reductions 372

registered attributes 33

registered processes 166 – 167

Registry implementation 248

Registry module 244 – 245, 253, 256, 267, 292, 331

Registry.lookup/2 function 245

Registry.register/3 function 245

Registry.start_link/1 function 244

release task 362

RELEASE_COOKIE environment variable 373

RELEASE_DISTRIBUTION environment variable 363, 367

RELEASE_NODE environment variable 363, 367

releases

contents of 364 – 367

handling 361

OTP 361 – 362

packaging in Docker containers 367 – 369

using 363 – 364

remote shell 357

remsh example 373

--remsh option 357

--remsh switch 369

replicated databases 343 – 346

request payload 185

requests, handling in GenServer 183 – 184

:rest_for_one restart strategy 256

:restart option 260

restarts, frequency of 237 – 238

:rex process 336

rows

deleting 289 – 291

inserting 289 – 291

:rpc Erlang module 335

rpc.erl file 336

run_async/2 function 154

run_erl tool 363

runtime considerations, unlimited process mailboxes 169 – 170

runtime errors 216 – 221

handling 218 – 221

runtime_tools application 372

runtime, starting 65 – 67

RuntimeError struct 219

S

scalability 142

schedulers, inner workings of 171 – 172

scripts, running 358 – 360

self/0 function 147

server processes 152

features of GenServer 186 – 189

process life cycle 189 – 190

server-side systems 7 – 9

:set table type 284

shared-nothing concurrency 170

shells, interactive 20 – 21

short names 327, 350

short-circuit operators 38

:shutdown option 255

SimpleRegistry.register/1 function 292

SimpleRegistry.whereis/1 function 292

:size option 308

--sname parameter 327

some_module 246

spawn_link/1 function 223

spawn/1 function 145

@spec attribute 34

special forms 63

split-brain situations 348

staircasing 15

start command 367

start_child/1 function 258 – 259

start_iex command 367, 369

stateful server processes 152 – 167

complex states 162 – 166

keeping process state 157 – 158

making state mutable 158 – 162

registered processes 166 – 167

stdlib application 306, 365

stop command 364

Stream functions 134

Stream module 107, 134, 137, 289

Stream.repeatedly/1 function 172

Stream.run/1 function 172

Stream.with_index/1 function 108

streams 106

String class 112

String module 76, 113

String.Chars protocol 135, 137

String.length/1 function 113

String.upcase/1 function 113

__struct__ field 123

structs 119 – 124

Stuff Goes Bad: Erlang in Anger (Hébert) 370

sum function 31

sum server process 14

sum/1 function 97

--sup parameter 298

supervision trees

organizing 253 – 256

registering database workers 247 – 249

separating loosely dependent parts 240 – 243

supervising database workers 250 – 253

via tuples 246 – 247

Supervisor module 182, 226, 251, 254, 267

Supervisor.child_spec/2 function 248

Supervisor.init/2 function 234

Supervisor.start_link function 226

Supervisor.start_link/2 function 226, 228, 234, 241

Supervisor.terminate_child/2 function 254

supervisors 226 – 238

child specifications 230 – 232

linking all processes 234 – 237

Poolboy example application, adapting pool 307 – 310

preparing existing code 227 – 228

restart frequency 237 – 238

starting process 228 – 230

starting processes dynamically

dynamic supervision 257 – 258

using temporary restart strategy 260 – 261

supervising dynamic tasks 272 – 273

supervisor behaviour 181

using callback modules 233 – 234

web server example, starting server 312 – 314

wrapping 233

:sys.get_state/1 function 374

:sys.replace_state/2 function 374

system behavior

analyzing 207 – 209, 370 – 371

logging 371 – 373

tracing 373 – 375

System.get_env/2 function 322

System.stop function 357

systems, running

analyzing system behavior 207 – 209, 370 – 371

OTP releases 361 – 362

running scripts 358 – 360

with Elixir tools, mix and elixir commands 356 – 358

T

tail function calls 96 – 99

take function 107

Task module 190, 254, 256, 267, 270

Task.async/1 function 268

Task.await/1 function 268 – 269

Task.start_link/1 function 270, 272

Task.Supervisor wrapper 272

tasks

awaited 268 – 270

non-awaited 270 – 272

supervising dynamic 272 – 273

tasks variable 269

temporary restart strategy 260 – 261

terminate/2 function 189

test macro 199, 315

:this option 328

throw/1 function 217

tick messages 348

Time module 59, 125

:timeout message 279

:timer.tc/1 function 371

tl function 42

to_erl tool 364

to-do cache, in distributed system example 338 – 343

to-do list example

agent-powered server 276 – 277

analyzing process dependencies 201 – 202

implementing cache 195 – 198

persisting data 204 – 207

refactoring using GenServer 180 – 181

starting processes dynamically, testing system 261 – 262

writing tests 198 – 201

todo script 364

todo_server variable 163

Todo.Cache interface function 227

Todo.Cache module 229, 231

Todo.Cache supervisor 258

Todo.Cache.init/1 function 205, 241

Todo.Cache.server_process/1 function 257, 259

Todo.Database implementation 212

Todo.Database module 203, 212

Todo.Database PID 204

tracing 373 – 375

trapping exits 224

truthiness 38

truthy values 38

try blocks 63

try special form 221

tuples 39 – 40

supervision trees via 246 – 247

type system

atoms 39

maps 46 – 49

types

higher-level types 56 – 59

immutability 43 – 46

other built-in types 55

U

unless expression 63, 89

unless macro 62

update operation 275

update_entry operation 128

update_entry request 165

update_in/2 macro 131

use Agent expression 277

use ExUnit.Case expression 198

use GenServer function 314

use macro 182

use Plug.Router function 314

V

value message handler 160

value of variable 73

value request 159 – 161

value/1 function 121, 161

variables

in patterns 72 – 73

overview of 22 – 23

via_tuple/1 function 247 – 249

:visible option 328

visualizing systems 310 – 311

W

web servers

handling requests 314 – 317

reasoning about system 317 – 321

starting 312 – 314

when clause 83

whereis/1 function 341

with expression 91 – 94

:worker_module option 308

workers 226

wrk tool 319