Class: BackgroundQueue::ServerLib::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/background_queue/server_lib/worker.rb

Overview

this is a worker which keeps track of how many connections are getting used by the worker.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Worker

Returns a new instance of Worker.



8
9
10
11
12
# File 'lib/background_queue/server_lib/worker.rb', line 8

def initialize(uri)
  @uri = uri
  @connections = 0
  @offline = false
end

Instance Attribute Details

#connectionsObject

Returns the value of attribute connections.



5
6
7
# File 'lib/background_queue/server_lib/worker.rb', line 5

def connections
  @connections
end

#offlineObject

Returns the value of attribute offline.



6
7
8
# File 'lib/background_queue/server_lib/worker.rb', line 6

def offline
  @offline
end

#uriObject

Returns the value of attribute uri.



4
5
6
# File 'lib/background_queue/server_lib/worker.rb', line 4

def uri
  @uri
end

Instance Method Details

#offline?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/background_queue/server_lib/worker.rb', line 14

def offline?
  @offline
end