I am working on a RFID card enabled music player. Currently I have a small Elixir app that runs recursively to accept user input (or more precisely RFID card scans) and then plays the corresponding music (by sending a
System.cmd message). I would like to be able to manage mapping the RFID card ids to the given music albums via a web GUI with phoenix.
Would it be possible to put everything inside a typical phoenix app and then just start everything up with
iex -S mix and spawn phoenix so I could capture the pid to be able to send messages to it (I would like to have the phoenix app handle the id mappings and the actual playing of the music, so my command line portion is only concerned with getting the ids and passing them along)?
If I run
iex -S mix phx.server then my code (recursive input handling) blocks the startup of the phoenix server (assuming that I put my input handling in
I looked into umbrella apps a little bit but they seemed like overkill for my situation…
What would be the best way to solve this?