Giter VIP home page Giter VIP logo

training_otp_in_elixir's Introduction

OTP in Elixir

Material for a training done at Elixir Club Kyiv in ~2020. ๐Ÿ‘ฉโ€๐Ÿซ

Requirements

How to use this repository

This repo contains the source code for the OTP in Elixir training.

During the training, we'll live-code a lot of the source code available here, but attendees will also be handed the full implementations for their reference.

During the training, we'll explore the following projects:

  • 01_concurrency_foundations - covers solid foundations of concurrency in the BEAM. Spawning processes, sending and receiving messages, monitors, state loops.

  • 02_terms_cache - covers a few ways of writing a terms cache, which is a process that can hold a key-value store of terms which are fast to store and retrieve. Starts with a single GenServer process, then adds TTL and cache eviction, and finally moves up to using an ETS table.

  • 03_redis_client - covers a barebones Redis client that can connect to Redis and execute commands. Starts with a blocking client which can handle one request at a time and then moves to a non-blocking client. These are implemented as GenServers: the last step here is rewriting them as state machines by using gen_statem.

  • 04_supervision_playground - an almost-empty app that we'll use to play around with supervisors and supervision trees.

  • 05_redis_pool - a small implementation of a pool built on top of Redix, Elixir's Redis client. We'll use this to illustrate a supervisor used in a real-world scenario plus some nifty concepts like :persistent_term.

  • 06_phoenix_observer - a boilerplate Phoenix app that we'll only use to run :observer and visually look at a complex supervision tree.

Then, there is some content that fits outside of our schedule and is provided as additional resources to attendees:

  • handrolled_genserver - contains a hand-rolled and significantly-but-not-unbelievably simplified version of how the GenServer behaviour is implemented under the hood (in Erlang/OTP). Also contains a "stack" process (that you can push to and pop from) implemented on top of the hand-rolled GenServer-like behaviour.

  • handrolled_supervisor - similar to the GenServer idea, contains a very simplified version of a supervisor that can start a list of children and restart them (mimicking a :one_for_one strategy).

Branches

The main branch contains the code we'll work on. It's mostly skeletons of modules. The code that is in there is boilerplate or helpers that will save us time during the training.

Should you want to peek at the "finished" code, the complete branch contains the complete code. What we come up with during the training might slightly differ from what's in the complete branch depending on how we go about implementing stuff.

Resources

training_otp_in_elixir's People

Contributors

whatyouhide avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.