Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exploring Processes and OTP behaviours in Erlang

Exploring Processes and OTP behaviours in Erlang

Dive into Erlang processes and the most used OTP behaviours

Paolo D'Incau

October 17, 2015
Tweet

More Decks by Paolo D'Incau

Other Decks in Programming

Transcript

  1. Funzionale General purpose Dinamico Concorrente Garbage collected - 1 -

    Erlang Run-Time System Ideato da Ericsson per la necessità di Business reali
  2. “If we want to write programs that behave as other

    objects behave in the real world, then these programs will have a concurrent structure. Use a language that was designed for writing concurrent applications, and development becomes a lot easier. Erlang programs model how we think and interact.” Joe Armstrong Programming Erlang - 1st Edition - 3 -
  3. - 4 - Moduli o Classi “It’s OO, but pretend

    it isn’t, please” Fred Hebert Joe Armstrong / Ralph Johnson infoq.com/interviews/johnson-armstrong-oop ferd.ca/an-open-letter-to-the-erlang-beginner-or-onlooker.html VENITE DAL MONDO OOP?
  4. P1 P2 P2 ! {self(), {increment, N}} - 10 -

    P1 ! {Pid2, Result} CHIAMATA SINCRONA
  5. - 19 - Modella il server di una relazione di

    tipo client-server Server Client Client Client Query Reply http:/ /www.erlang.org/doc/design_principles/gen_server_concepts.html GEN_SERVER
  6. - 22 - State(S) x Event(E) -> Actions(A), State(S') Lobby

    Idle Disconnected Reconnected timeout Stop GEN_FSM
  7. - 24 - GEN_EVENT server event manager g(event) f(event) h(event)

    event “Profiling and Debugging Erlang Systems” Martin Kjellin, Roberto Aloi youtube.com/watch?v=4u6c2FNauYE
  8. - 25 - SUPERVISOR Main Sup. GCM 2 GCM 1

    Il cuore della affidabilità di Erlang
  9. - 26 - SUPERVISOR Sup. Main Sup. Seq. Worker Stash

    Worker “OTP: Supervisors” Programming Elixir Dave Thomas
  10. - 27 - APPLICATION Raccoglie codice comune a una funzionalità

    start/stop Organizzazione dei file Gestione delle configurazioni Riutilizzabile
  11. - 28 - RELEASE Una "release" è un insieme di

    applicazioni Erlang deployate ed eseguite assieme rebar3 è un grande passo avanti Gestione configurazioni
  12. - 29 - Erlang in production: "I wish I'd known

    that when I started" Bernard Duggan youtube.com/watch?v=G0eBDWigORY Thinking like an Erlanger Torben Hoffmann youtube.com/watch?v=_fgaPGLGZI0 RISORSE UTILI