Description
In this course, you will :
- Discover how to create an Elixir web application using a purely functional finite state machine.
- Master OTP Behaviors and gain confidence in using OTP in any application.
- Learn how to use OTP for concurrency, parallelism, and fault tolerance.
- Learn how to use Phoenix channels and Presence to create and track stateful, persistent connections.
- Learn how to use Phoenix to create a web interface.
Syllabus :
1. Mapping Our Route
- Explore the Route
- What Lies Ahead?
2. Model Data and Behavior
- Define the Functional Core in Elixir
- Start the Game
- Discover the Entities and Model the Domain
- Model Coordinates
- Guesses
- Islands
- Boards
- Hits and Misses
- Islands in Action
- Play the Game
3. Working of State Machines
- Manage the State with a State Machine
- A History of State
- A Different Path
- A Functional State Machine for Islands
- Module and Functions
- The Initialized State
- The Players Set
- Player One’s Turn
- Player Two’s Turn
- Game Over
4. Add OTP for Concurrency and Fault Tolerance
- Wrap It Up in a GenServer
- A Look at Microservices
- OTP Solutions
- GenServer and Application
- Getting Started with GenServer
- The GenServer Pattern
- Passing Messages
- Introduce Calls and Casts
- Initialize the GenServer State
- Customize GenServer Behavior
- Add a New Player
- Position the Islands
- Set the Islands
- Guess a Coordinate
- Name GenServer Processes
5. Process Supervision for Recovery
- Introduction
- Linking Processes in Supervision
- Long-running Processes
- Link Processes
- Introduce the Supervisor's Behavior
- Conditions of Child Processes in Supervision
- The Child Specification
- Build a Supervisor for the Game
- Start the Supervision Tree
- Start and Stop Child Processes
- Set Timeouts
- Put the Pieces Together
- Recover the State After a Crash
- Get Started with ETS
- Store and Retrieve the Game State
- Cleaning Up After a Game
6. Generate a New Web Interface with Phoenix
- Add a Web Interface with Phoenix
- Phoenix Is Not Your Application
- Applications
- Manage Dependencies
- Start and Stop Applications
- Generate a New Phoenix Application
- Add a New Dependency
- Call the Logic from the Interface
7. Create Persistent Connections with Phoenix Channels
- Phoenix Channels
- The Moving Parts of a Channel
- Let’s Build It
- Define a New Module
- Establish a Client Connection
- Converse Over a Channel
- Communication Between Players
- Connect the Channel to the Game
- Add a Second Player
- Position the Islands
- Set the Islands
- Guess the Coordinates
- Phoenix Presence
- Authorization