hugolnx

hugolnx

Hey!

I created a simple project using GenStage only to study more deeply how the processes comunicate with each other. Instead of using the default erlang tracer, I implemented a prettier tracer and also added some extra logging stuff, that help me understand better how the stages behave with different max_demand and min_demand configurations.

The Stages

[Stock] ----------> [Chef] ------------> [Checkout] >>>>>>>>> Checkout.Task

A example of the tracing logs

15:50.768 trace: :chef      => :stock                    {:subscribe, nil, [min_demand: 3, max_demand: 5]}
15:50.768 trace: :chef      => :stock                    {:ask, 5}
15:50.769 trace: :checkout  => :chef                     {:subscribe, nil, [min_demand: 0, max_demand: 2]}
15:50.769 trace: :checkout  => :chef                     {:ask, 2}
15:52.031 trace: :stock     => :chef                     {:snt, 5}
15:53.037 trace: :chef      => :checkout                 {:snt, 2}
15:53.038 trace: :chef      => :stock                    {:ask, 2}
15:53.039 trace: :checkout  => {:task, #PID<0.255.0>}    :acai1029
15:53.039 trace: :checkout  => {:task, #PID<0.256.0>}    :acai1093
15:53.543 trace: :stock     => :chef                     {:snt, 2}
15:54.039 trace: :checkout  => :chef                     {:ask, 1}
...

Repository: https://github.com/HugoLnx/acai-restaurant

Hope it help. :wink:

PS.: I created a few issues with some ideas.

Where Next? Top

Trending in Guides/Tuts Top

c4lliope
# ~/src/livebook/.iex.exs System.cmd("xdg-open", [ LivebookWeb.Endpoint.access_url() ] ) Because Livebook requires a unique passcode on ...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews