简体   繁体   中英

Multiple Worker Streams Sidekiq Icecast Rails

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

All I had to do was run 2 sidekiq processes 1 running with the params -q radioworker and 1 running with -q testworker. Sorry if the problem description was vague.I was trying to run 2 processes with 1 thread each.Not 1 process with 2 threads. Thanks for the help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM