Class: Protor::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/protor/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Client

Returns a new instance of Client.



5
6
7
8
# File 'lib/protor/client.rb', line 5

def initialize(configuration)
  @options = configuration
  @retries = 0
end

Instance Method Details

#publish(payload) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/protor/client.rb', line 10

def publish(payload)
  connect
  payload.each do |message|
    send(message)
  end
rescue Errno::EPERM, Errno::ECONNREFUSED => e
  options.logger.error(e)
ensure
  close
end