Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo system

https://www.youtube.com/watch?v=JvBT4XBdoUE

Getting started

Requires Erlang, Elixir, and node.js, as specified in the .tool-versions file. You can use asdf for that.

load_control folder is a library directly being used by the example_system mix project, which is the demo app.

Building:

cd example_system

mix deps.get &&
mix assets.build &&
mix assets.deploy &&
mix compile

Starting for development with live reload (recommended for following with youtube):

iex -S mix phx.server

Then, you can visit the following links:

Env

image

Demo

Building and starting for production (in the background):

cd example_system
MIX_ENV=prod mix release
./_build/prod/rel/example_system/bin/server

Open the remote console:

./_build/prod/rel/example_system/bin/example_system remote_console

Hot upgrade with no downtime:

MIX_ENV=prod mix example_system.upgrade

Processes structure overview

Load

Application start

  1. ExampleSystem.Metrics.init/1
  • calls LoadControl.subscribe_to_stats/0
  1. LoadControl.subscribe_to_stats/0
  • is a defdelegate to LoadControl.Stats.subscribe/0
  1. LoadControl.Stats.subscribe/0
  • stores LoadControl pid to its subscribers list in state
  • because this was called via defdelegate, this function is viewed as if a public function of LoadControl

Routing to /load in browser

  1. ExampleSystemWeb.Load.Dashboard.mount/3
  • calls ExampleSystem.Metrics.subscribe/0
  1. ExampleSystem.Metrics.subscribe/0
  • gets the calling pid (Dashboard LiveView), stores into its list of subscribes in state

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages