osteria
osteria copied to clipboard
Osteria demo app for GenStage in the Kitchen talk. Rough code, beware!
Osteria
Demo application for Elixir.LDN's talk "GenStage in the Kitchen" slides here
Setup
mix deps.get
iex -S mix
Then visit http://localhost:4001
Frontend
The frontend application is built with Elm, so it requires it to be installed.
Compiled js and css is shipped with the codebase, so you don't need to compile by hand after cloning. If you wish to make any changes you can:
cd frontendmake installmaketo compilemake watchto start a watcher that recompiles on save
Some directions when reading code
- Start from
lib/osteria.ex: here all processes are setup in single supervision tree. - The
Osteria.Statusmodule is used to collect information about each component in the system, so that we can pipe that information to the frontend. - You can then move to
lib/osteria/table.exand see how each table handles people sitting down and deciding dishes. Note that to keep track of tables we use aOsteria.TableRegistryElixir 1.4 process Registry. - The
Waitermodule is modeled after theEventManagerexample shown here: http://elixir-lang.org/blog/2016/07/14/announcing-genstage/. - The
Osteria.Chefmodule partitions orders using aOsteria.Menumodule to figure out a dish type (grill, oven, etc.) - If you open the
Osteria.Logmodule you can enable logging (roughly commented out towards the end). That way you can see events happening in real time in the console.