July 2021
Intermediate to advanced
176 pages
4h 14m
English
We are going to continue working on the sender project from the previous chapter. If you decided to skip that part, please see Creating Our Playground and follow the steps to create a new Elixir project and make the required change in sender.ex. We are going to create a GenServer process from scratch and see how it compares to Task processes.
First, we’re going to create a new file in the lib directory. Let’s name it send_server.ex. In that file, we’ll define our SendServer module like so:
| | defmodule SendServer do |
| | use GenServer |
| | |
| | end |
The use macro for the GenServer module does two things for us. First, it automatically injects the line @behaviour GenServer in our SendServer module. If you’re not ...
Read now
Unlock full access