Recording not yet published
OTP Process Abstractions with proc_lib
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.