Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Beam way of life
1. BEAM way of life
How you can solve problem in BEAM world
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
4. GenServer
- Keep the state in the process
- “Share” state between other processes
- Synchronize
- But it’s a Bottleneck
- Spawn & reply
- Examples ...
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. 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. 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
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!!!!