Hi Folks,
I have an umbrella project, where Phoenix is (for now) simply the HTTP interface.
I was banging my head against the wall because I was starting up a process in the iex console - iex -S mix
- then making POST request to the Phoenix app and asking the Phoenix app to forward some data to the process I had started via iex
(so that the process could do some work).
As most of you probably guessed by now, that process that was started in iex
was not available to the Phoenix app. It was only after I created an endpoint in the Phoenix app to start the process, and THEN making the POST request, that everything started to work.
It seems to me that iex -S mix
and mix phoenix.server
started two separate BEAM instances and therefore couldn’t communicate. Is this correct? I’d like to know more about what is going on because this was an expensive lesson, so I’d like to make sure to learn it right.
Thanks!