This device is not compatible.

Create a GenServer and Supervisor From Scratch

PROJECT


Create a GenServer and Supervisor From Scratch

Learn to create and use GenServers. In this project, we’ll create a GenServer and look at how its callback functions work. We’ll also see how to use supervisors for fault tolerance in Elixir applications.

Create a GenServer and Supervisor From Scratch

You will learn to:

Make synchronous and asynchronous calls in an Elixir application.

Handle concurrency in Elixir applications.

Design scalable applications.

Implement autoscaling on application level.

Skills

Distributed Application Development

Auto Scaling Applications

Concurrency

Prerequisites

Basic understanding of Elixir

Good understanding of distributed applications

Technology

Elixir

Project Description

A GenServer is an Elixir process that executes code asynchronously and keeps the state consistent. However, GenServers must be restarted if they crash or stop due to unforeseen circumstances. Supervisors are used to resume the GenServer or any other process as soon as it stops.

In the first part of this project, we’ll create a GenServer and make synchronous and asynchronous calls to the server. Further on, we’ll learn how to communicate within the GenServer.

In the second part, we’ll see how supervisors are used to make an application fault-tolerant. Lastly, we’ll learn how to start processes—without user intervention—as soon as the application starts.

Project Tasks

1

Setup

Task 0: Get Started

Task 1: Create a GenServer

Task 2: Run the Server

2

GenServer

Task 3: Use Call and Cast Functions

Task 4: Verify the Functions

Task 5: Use Functions in a Module

Task 6: Use Process in GenServer

Task 7: Verify the GenServer

Task 8: Terminate the GenServer

3

Supervisor

Task 9: Create a Supervisor

Task 10: Verify the Supervisor

4

Application

Task 11: Create an Application

Task 12: Run the Application

Congratulations!

has successfully completed the Guided ProjectCreate a GenServer and Supervisor From Scratch

Relevant Courses

Use the following content to review prerequisites or explore specific concepts in detail.