Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Beam way of life

295 views

Published on

My keynote for http://www.italian-elixir.org/ The examples are here:

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Beam way of life

  1. 1. BEAM way of life How you can solve problem in BEAM world
  2. 2. GPad Born to be a developer with an interest in distributed system. I develop using many languages like C++, C#, js and ruby. I had fallen in love with functional programming, especially with elixir, erlang. - Twitter: https://twitter.com/gpad619 - Github: https://github.com/gpad/ - Medium: https://medium.com/@gpad CTO & founder of coders51
  3. 3. Functional Language - Immutability - No global variables - Where do I put my state? - How can we share state? (We can’t) - Examples ...
  4. 4. GenServer - Keep the state in the process - “Share” state between other processes - Synchronize - But it’s a Bottleneck - Spawn & reply - Examples ...
  5. 5. Not only GenServer - Gen_statem (ex gen_fsm) - Implement a state machine - Can be supervised - Can manage timer of different type - GenEvent - GenStage - Flow - Supervisor
  6. 6. Supervisor - Not only for GenServer - Which type? - One_for_one - One_for_all - Rest_for_one - Simple_one_for_one - Make some example - You can add it dynamically (Example)
  7. 7. Console/Attach - You are inside the same VM - It’s not a different process on same DB - You can inspect the behavior of some processes - You can add code - You can Fix the code
  8. 8. Console - Examples
  9. 9. Advice - Try to use OTP construct - Don’t reinvent the wheel - Processes means concurrency - Use if/when necessary - Inspect a running system - Enjoy with BEAM!!!!
  10. 10. Thank you!

×