Life of an Erlang process

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Life of an Erlang process

A high-level introduction to the Erlang programming language: among other topics, the talk covers Erlang processes, message passing, supervision trees, the let-it-crash approach and more.
We unfold the skeleton of an Erlang process, explaining how the functional model makes the implementation of Erlang processes straightforward. We reveal the recipe of the secret Erlang sauce which makes possible the creation of reliable, scalable systems which never go down.

Roberto Aloi

March 28, 2015

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

39 slides
  1. Cheap to create Cheap to context switch OS processes out

    of discussion Use lightweight processes Built-in distribution to horizontally scale
  2. How are processes made? This is a little embarrassing, but…

    Ahem… I’m not sure I understand everything of it… I’ve heard rumours, still… Do you, do you mind if I ask you…
  3. Pid2 Pid1 Pid2 ! {self(), Msg} {Pid1, Msg} receive {From,

    start} -> … {From, stop} -> … end Send Receive
  4. start(Args) -> spawn(server, init, [Args]) init(Args) -> State = do_init(Args),

    loop(State). loop(State) ->
 receive
 {handle, Msg} -> 
 NewState = handle(Msg, State),
 loop(NewState);
 stop -> terminate(State)
 end. terminate(State) -> clean_up(State). Start Stop Initialize Terminate Loop
  5. erlang.org github.com/erlang/otp erlang-solutions.com www.learnyousomeerlang.org Erlang Programming Erlang and OTP in

    Action Official Home Page Sources Binary Packages, News, Events Best Online Tutorial Best book about basics Best book about OTP Where to Start

More Decks by Roberto Aloi

Other Decks in Programming