Module: Progstr::Client

Extended by:
Client
Included in:
Client
Defined in:
lib/progstr/client.rb

Instance Method Summary collapse

Instance Method Details

#send(message) ⇒ Object

Raises:



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/progstr/client.rb', line 5

def send(message)
  raise NoApiKeyError if Progstr.api_key.nil?

  pool.schedule do
    begin
      execute(message)
    rescue Timeout::Error, 
            Errno::EINVAL,
            Errno::ECONNRESET,
            Errno::ECONNREFUSED,
            EOFError,
            SocketError,
            Net::HTTPBadResponse,
            Net::HTTPHeaderSyntaxError,
            Net::ProtocolError => error
      #puts "Progstr::Client.send: #{error.message}"
      #puts error.backtrace.join("\r\n")
    end
  end
end