Wondering why I can only have 1 stream listening on a specific port on sidekiq/redis/icecast Rails Stream app. My files are as following:
icecast.xml
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>35687</port>
<shoutcast-mount>/hiphop</shoutcast-mount>
<!-- <bind-address>127.0.0.1</bind-address> -->
<!-- <shoutcast-mount>/stream</shoutcast-mount> -->
</listen-socket>
<listen-socket>
<port>35690</port>
<shoutcast-mount>/rock</shoutcast-mount>
</listen-socket>
2 workers on rails
class RadioWorker
include Sidekiq::Worker
sidekiq_options :queue => :radioworker
def perform(*_args)
prev_song = nil
s = Shout.new # ruby-shout instance
s.mount = "/rock" # our mountpoint
s.charset = "UTF-8"
s.port = 35690 # the port we've specified earlier
s.host = 'localhost' # hostname
s.user = 'source' # credentials
s.pass = 'parolata'
s.format = Shout::MP3 # format is MP3
s.description = 'Geek Radio' # an arbitrary name
s.connect
class TestWorker
include Sidekiq::Worker
sidekiq_options :queue => :testworker
def perform(*_args)
prev_song = nil
s = Shout.new # ruby-shout instance
s.mount = "/hiphop" # our mountpoint
s.charset = "UTF-8"
s.port = 35687 # the port we've specified earlier
s.host = 'localhost' # hostname
s.user = 'source' # credentials
s.pass = 'parolata'
s.format = Shout::MP3 # format is MP3
s.description = 'Geek Radio' # an arbitrary name
s.connect
both workers have been set to perform async in initializer/sidekiq.rb and I have the sidekiq queues defined in config/sidekiq.yml
:queues:
- ["radioworker", 1]
- ["testworker", 1]
Currently It seems as if on an instance of bundle exec sidekick -C config/sidekiq.yml I can only listen to 1 of the 2 streams. How can I have them both running at the same time and be able to listen to them?
Thanks in advance
fork
and spawn sub-processes that connect to the icecast endpoints? – Srdjan Pejic