{"id":16657552,"url":"https://github.com/whatyouhide/training_otp_in_elixir","last_synced_at":"2025-04-09T18:24:43.739Z","repository":{"id":71491941,"uuid":"272385174","full_name":"whatyouhide/training_otp_in_elixir","owner":"whatyouhide","description":"\"OTP in Elixir\" training done at Elixir Club Kyiv in ~2020. 👩‍🏫","archived":false,"fork":false,"pushed_at":"2023-01-08T07:50:27.000Z","size":80,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-23T20:24:45.433Z","etag":null,"topics":["elixir","elixir-lang","erlang","erlang-otp","learning","training-material","training-materials"],"latest_commit_sha":null,"homepage":"https://www.meetup.com/Elixir-Club/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whatyouhide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-15T08:37:19.000Z","updated_at":"2023-09-07T00:38:30.000Z","dependencies_parsed_at":"2023-05-28T18:00:39.055Z","dependency_job_id":null,"html_url":"https://github.com/whatyouhide/training_otp_in_elixir","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatyouhide%2Ftraining_otp_in_elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatyouhide%2Ftraining_otp_in_elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatyouhide%2Ftraining_otp_in_elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whatyouhide%2Ftraining_otp_in_elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whatyouhide","download_url":"https://codeload.github.com/whatyouhide/training_otp_in_elixir/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248086350,"owners_count":21045329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-lang","erlang","erlang-otp","learning","training-material","training-materials"],"created_at":"2024-10-12T10:00:54.164Z","updated_at":"2025-04-09T18:24:43.717Z","avatar_url":"https://github.com/whatyouhide.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OTP in Elixir\n\n\u003e Material for a training done at [Elixir Club Kyiv](https://www.meetup.com/Elixir-Club/) in ~2020. 👩‍🏫\n\n## Requirements\n\n  * Elixir 1.10\n  * Erlang/OTP 21 or later\n  * [Docker](https://www.docker.com/get-started)\n  * [Docker Compose](https://docs.docker.com/compose/install/)\n\n## How to use this repository\n\nThis repo contains the source code for the [*OTP in Elixir*\ntraining](http://www.elixirkyiv.club).\n\nDuring the training, we'll live-code a lot of the source code available here,\nbut attendees will also be handed the full implementations for their reference.\n\nDuring the training, we'll explore the following projects:\n\n  * `01_concurrency_foundations` - covers solid foundations of concurrency in\n    the BEAM. Spawning processes, sending and receiving messages, monitors,\n    state loops.\n\n  * `02_terms_cache` - covers a few ways of writing a *terms cache*, which is a\n    process that can hold a key-value store of terms which are fast to store and\n    retrieve. Starts with a single GenServer process, then adds TTL and cache\n    eviction, and finally moves up to using an ETS table.\n\n  * `03_redis_client` - covers a barebones Redis client that can connect to\n    Redis and execute commands. Starts with a *blocking* client which can handle\n    one request at a time and then moves to a non-blocking client. These are\n    implemented as GenServers: the last step here is rewriting them as state\n    machines by using `gen_statem`.\n\n  * `04_supervision_playground` - an almost-empty app that we'll use to play\n    around with supervisors and supervision trees.\n\n  * `05_redis_pool` - a small implementation of a pool built on top of\n    [Redix](https://github.com/whatyouhide/redix), Elixir's Redis client. We'll\n    use this to illustrate a supervisor used in a real-world scenario plus some\n    nifty concepts like `:persistent_term`.\n\n  * `06_phoenix_observer` - a boilerplate Phoenix app that we'll only use to run\n    `:observer` and visually look at a complex supervision tree.\n\nThen, there is some content that fits outside of our schedule and is provided as\nadditional resources to attendees:\n\n  * `handrolled_genserver` - contains a hand-rolled and\n    significantly-but-not-unbelievably simplified version of how the `GenServer`\n    behaviour is implemented under the hood (in Erlang/OTP). Also contains a\n    \"stack\" process (that you can push to and pop from) implemented on top of\n    the hand-rolled GenServer-like behaviour.\n\n  * `handrolled_supervisor` - similar to the GenServer idea, contains a *very*\n    simplified version of a supervisor that can start a list of children and\n    restart them (mimicking a `:one_for_one` strategy).\n\n## Branches\n\nThe `main` branch contains the code we'll work on. It's mostly skeletons of\nmodules. The code that is in there is boilerplate or helpers that will save us\ntime during the training.\n\nShould you want to peek at the \"finished\" code, the `complete` branch contains\nthe complete code. What we come up with during the training might slightly\ndiffer from what's in the `complete` branch depending on how we go about\nimplementing stuff.\n\n## Resources\n\n  * Documentation for [`Task`](https://hexdocs.pm/elixir/Task.html), which we\n    reimplemented parts of\n  * Documentation for [`GenServer`](https://hexdocs.pm/elixir/GenServer.html),\n    which is full of nice tips and things to learn\n  * Documentation for [`ets`](http://erlang.org/doc/man/ets.html), equally dense\n    of interesting stuff to read\n  * [Erlang efficiency guide on\n    processes](http://erlang.org/doc/efficiency_guide/processes.html#creating-an-erlang-process)\n  * Two of my blog posts about connection processes in OTP:\n    * \u003chttps://andrealeopardi.com/posts/handling-tcp-connections-in-elixir\u003e\n    * \u003chttps://andrealeopardi.com/posts/connection-managers-with-gen_statem\u003e\n  * Insightful post from Fred Hebert about what supervisors and restarts are\n    meant for: [*It's about the\n    guarantees*](https://ferd.ca/it-s-about-the-guarantees.html)\n  * One of the best books to learn in depth about OTP and its design patterns:\n    [*Designing for Scalability with\n    Erlang/OTP](https://www.oreilly.com/library/view/designing-for-scalability/9781449361556/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhatyouhide%2Ftraining_otp_in_elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhatyouhide%2Ftraining_otp_in_elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhatyouhide%2Ftraining_otp_in_elixir/lists"}