OTP Process Abstractions with proc lib | Mitchell Hanberg | Code BEAM America 2022
This video was recorded at Code BEAM America 2022 - https://codebeamamerica.com/ OTP Process Abstractions with proc lib | Mitchell Hanberg - Senior Software Engineer at Simplebet ABSTRACT Creating your own generic process abstraction can allow developers to focus on their implementation and not worry about boilerplate. Examples of this exist in OTP with `gen_server`, in Elixir’s Task, and in libraries like Phoenix with Channels. Using `proc_lib`, you can quickly create your own process abstractions that are OTP-compliant: they’re able to be supervised, respond to debugging tools like `sys:get_state/1`, and have their own custom callbacks (`handle_foo`). This is how `gen_server` and `gen_statem` are implemented. In this talk, we’ll explore all the different features that you’ve seen in OTP-compliant processes, what we might want in our own, and hypothesize what it takes to build one. We’ll take this hypothesis and walk through building an abstraction for making custom language servers using the Language Server Protocol. In the end, we’ll see that in just a few lines of code, we can easily build our own OTP-compliant process abstraction and use it to build a process. Talk objectives: Show developers the tools for creating valuable abstractions in their libraries and application code and give them insight into how the builtin tools are written. Target audience: Elixir and Erlang developers looking to increase their understanding and proficiency with OTP. • Timecodes 00:00 - 03:46 - Intro 03:47 - 09:28 - What makes the BEAM special? 09:29 - 11:10 - :gen_server 11:11 - 26:18 - Language Server Protocol: A quick primer 26:19 - 28:28 - Demo. We're doing it live! 28:29 - 32:13 - QnA • Follow us on social: Twitter: https://twitter.com/CodeBEAMio LinkedIn: https://www.linkedin.com/company/27159258 • Looking for a unique learning experience? Attend the next Code Sync conference near you! See what's coming up at: https://codesync.global • SUBSCRIBE TO OUR CHANNEL https://www.youtube.com/channel/UC47eUBNO8KBH_V8AfowOWOw See what's coming up at: https://codesync.global