Class: Groonga::Client::Protocol::HTTP::Coolio::GroongaHTTPClient

Inherits:
Coolio::HttpClient
  • Object
show all
Includes:
PathResolvable
Defined in:
lib/groonga/client/protocol/http/coolio.rb

Instance Method Summary collapse

Constructor Details

#initialize(socket, callback) ⇒ GroongaHTTPClient

Returns a new instance of GroongaHTTPClient.



44
45
46
47
48
49
# File 'lib/groonga/client/protocol/http/coolio.rb', line 44

def initialize(socket, callback)
  super(socket)
  @body = ""
  @callback = callback
  @finished = false
end

Instance Method Details

#finished?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/groonga/client/protocol/http/coolio.rb', line 51

def finished?
  @finished
end

#on_body_data(data) ⇒ Object



55
56
57
# File 'lib/groonga/client/protocol/http/coolio.rb', line 55

def on_body_data(data)
  @body << data
end

#on_closeObject



63
64
65
66
# File 'lib/groonga/client/protocol/http/coolio.rb', line 63

def on_close
  super
  @finished = true
end

#on_request_completeObject



59
60
61
# File 'lib/groonga/client/protocol/http/coolio.rb', line 59

def on_request_complete
  @callback.call(@body)
end