elixirellomax

elixirellomax

Need some help understanding Commanded

Hi everyone, i’m new to this forum but no so much to elixir. Could anyone please help me to better understand Commanded.
I know that it keeps one genserver per aggregate, but does it keep current aggregate’s state in it? I mean when you need to apply a command to an aggregate, what does it do?

  • Does it fetch all previous events from store, builds the aggregate and apply the command?
  • Does it keep some sort of struct in it to which it applies the command?
    If it is the first case, how can i log those queries against the eventstore?
    Thanks in advance

Marked As Solved

y86

y86

In Commanded, after you dispatch your command, it will find the aggregate the needs to handle it based on your router. Once it finds the aggregate, if it is not running yet, it will spawn the aggregate server, load all relevant events from its subscription to get to its current state, then it executes the command. From that point onwards, as long as the aggregate is alive, the current state is in its memory.

After commands are handled, 0 or more events can be generated, which in turn are processed by the aggregate to update its state.

Regarding logging the queries to the eventstore, I’ve never really had the need for it and I am not sure if there is an option you can toggle to see them. I’d say that you can take a look at the evenstore guides (I am assuming you’re using commanded’s Postgres’s eventstore) eventstore/guides at master · commanded/eventstore · GitHub to see if there is an option for that.

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New

Other popular topics Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement