Class: ProxyService::Worker

Inherits:
QueueWorker
  • Object
show all
Defined in:
lib/proxy_service/worker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message.



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

def message
  @message
end

#ready=(value) ⇒ Object (writeonly)

Sets the attribute ready

Parameters:

  • value

    the value to set the attribute ready to.



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

def ready=(value)
  @ready = value
end

Class Method Details

.stompObject



8
9
10
# File 'lib/proxy_service/worker.rb', line 8

def self.stomp
  QueueWorker.stomp
end

Instance Method Details

#call(message) ⇒ Object



12
13
14
15
# File 'lib/proxy_service/worker.rb', line 12

def call(message)
  @message = message
  @ready = true
end

#ready?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/proxy_service/worker.rb', line 17

def ready?
  !!@ready
end

#release(proxy, is_blocked) ⇒ Object



21
22
23
24
25
26
# File 'lib/proxy_service/worker.rb', line 21

def release(proxy, is_blocked)
  ack(message)
  unsubscribe
  publish(proxy) unless is_blocked
  close
end