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

Inherits:
Coolio::HttpClient
  • Object
show all
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.



41
42
43
44
45
46
# File 'lib/groonga/client/protocol/http/coolio.rb', line 41

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

Instance Method Details

#finished?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/groonga/client/protocol/http/coolio.rb', line 48

def finished?
  @finished
end

#on_body_data(data) ⇒ Object



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

def on_body_data(data)
  @body << data
end

#on_closeObject



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

def on_close
  super
  @finished = true
end

#on_request_completeObject



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

def on_request_complete
  @callback.call(@body)
end