Skip to content

This code example is one study about elixir OTP application using GenServer and Supervisors.

License

Notifications You must be signed in to change notification settings

FabioRNobrega/elexir-otp-genserver-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElhexDelivery | Farno

One code example is a study about elixir OTP applications using GenServe and Supervisors. Following a YouTube class made by omgneering. For more info see the official GenServer DOC and Supervisor DOC.

OBS: The original tutorial has some deprecated implementation, so i refactor the new way of using supervisors. You can find the old way at example/deprecated-supervisor-implementation branch and the new way at the master branch.

I use:

  • Erlang/OTP 24
  • IEx 1.13.4 (compiled with Erlang/OTP 22)

The ZipCode was found on Census.org

Table of contents

Install

For run this application you need to have erlang and Elixir installed. You can follow the ElixirSchool tutorial to help you with that.

Usage

Clone this repo and cd into and run

iex -S mix

After compile with the command above you will be able to access ao functions to calculate position base in two zipCodes from USA. For example the distance between Minneapolis, MN ZipCode 55401 to Austin, TX ZipCode78703 run.

ElhexDelivery.PostalCode.Navigator.get_distance(55401, 78703)

Tests

The tests are made using ExUnit and can be found on the test folder. To run use

mix test

Git Guideline

Create your branches and commits using the English language and following this guideline.

Branches

  • Feature: feat/branch-name
  • Hotfix: hotfix/branch-name
  • POC: poc/branch-name
  • Example example/branch-name

Commits prefix

  • Chore: chore(context): message
  • Feat: feat(context): message
  • Fix: fix(context): message
  • Refactor: refactor(context): message
  • Tests: tests(context): message
  • Docs: docs(context): message

About

This code example is one study about elixir OTP application using GenServer and Supervisors.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages