I have a Procfile like so:
web: bundle exec rails server -p $PORT
em: script/eventmachine
The em
process fires up an eventmachine with start_server
(port ENV['PORT']
) and my web process occasionally needs to communicate with it.
My question is how does the web process know what port to communicate with it on? If I understand heroku correctly it assigns you a random port when the process starts up (and it can change if the ps is killed or restarted). Thanks!