Class: Banter::Server::SubscriberServer

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/banter/server/subscriber_server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#banter_worker_idObject (readonly)

Returns the value of attribute banter_worker_id.



19
20
21
# File 'lib/banter/server/subscriber_server.rb', line 19

def banter_worker_id
  @banter_worker_id
end

#hostnameObject (readonly)

Returns the value of attribute hostname.



19
20
21
# File 'lib/banter/server/subscriber_server.rb', line 19

def hostname
  @hostname
end

#pidObject (readonly)

Returns the value of attribute pid.



19
20
21
# File 'lib/banter/server/subscriber_server.rb', line 19

def pid
  @pid
end

#process_nameObject (readonly)

Returns the value of attribute process_name.



19
20
21
# File 'lib/banter/server/subscriber_server.rb', line 19

def process_name
  @process_name
end

#workersObject (readonly)

Returns the value of attribute workers.



19
20
21
# File 'lib/banter/server/subscriber_server.rb', line 19

def workers
  @workers
end

Class Method Details

.instanceObject



21
22
23
# File 'lib/banter/server/subscriber_server.rb', line 21

def self.instance
  @instance ||= new
end

Instance Method Details

#set_workers(subscribers) ⇒ Object



25
26
27
# File 'lib/banter/server/subscriber_server.rb', line 25

def set_workers(subscribers)
  @workers = subscribers.map { |subscriber| create_queue_listeners(subscriber) }
end

#startObject



29
30
31
32
33
34
35
36
# File 'lib/banter/server/subscriber_server.rb', line 29

def start
  set_information
  start_workers
  handle_interrupts
  handle_teardown
ensure
  stop_worker
end