Class: Banter::Server::SubscriberServer
- Inherits:
-
Object
- Object
- Banter::Server::SubscriberServer
- Includes:
- Celluloid
- Defined in:
- lib/banter/server/subscriber_server.rb
Instance Attribute Summary collapse
-
#banter_worker_id ⇒ Object
readonly
Returns the value of attribute banter_worker_id.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#process_name ⇒ Object
readonly
Returns the value of attribute process_name.
-
#workers ⇒ Object
readonly
Returns the value of attribute workers.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#banter_worker_id ⇒ Object (readonly)
Returns the value of attribute banter_worker_id.
20 21 22 |
# File 'lib/banter/server/subscriber_server.rb', line 20 def banter_worker_id @banter_worker_id end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
20 21 22 |
# File 'lib/banter/server/subscriber_server.rb', line 20 def hostname @hostname end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
20 21 22 |
# File 'lib/banter/server/subscriber_server.rb', line 20 def pid @pid end |
#process_name ⇒ Object (readonly)
Returns the value of attribute process_name.
20 21 22 |
# File 'lib/banter/server/subscriber_server.rb', line 20 def process_name @process_name end |
#workers ⇒ Object (readonly)
Returns the value of attribute workers.
20 21 22 |
# File 'lib/banter/server/subscriber_server.rb', line 20 def workers @workers end |
Class Method Details
.instance ⇒ Object
22 23 24 |
# File 'lib/banter/server/subscriber_server.rb', line 22 def self.instance @instance ||= new end |
Instance Method Details
#register_workers ⇒ Object
40 41 42 43 |
# File 'lib/banter/server/subscriber_server.rb', line 40 def register_workers return unless Banter::Configuration.web_enabled BanterWorker.worker_started end |
#set_workers(subscribers) ⇒ Object
26 27 28 |
# File 'lib/banter/server/subscriber_server.rb', line 26 def set_workers(subscribers) @workers = subscribers.map { |subscriber| create_queue_listeners(subscriber) } end |
#start ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/banter/server/subscriber_server.rb', line 30 def start set_information register_workers start_workers handle_interrupts handle_teardown ensure stop_worker end |