Project

gqtp

0.01
No commit activity in last 3 years
No release in over 3 years
Gqtp gem provides both GQTP client, GQTP server and GQTP proxy implementations. They provide asynchronous API. You can use gqtp gem for high concurrency use.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

README

Name

gqtp

Description

Gqtp gem is a GQTP (Groonga Query Transfer Protocol) Ruby implementation.

Gqtp gem provides both GQTP client, GQTP server and GQTP proxy implementations. They provide asynchronous API. You can use gqtp gem for high concurrency use.

Install

% gem install gqtp

Usage

Client

client = GQTP::Client.new(:host => "192.168.0.1", :port => 10043)
request = client.send("status") do |header, body|
  p body # => "{\"alloc_count\":163,...}"
end
request.wait

Server

server = GQTP::Server.new(:host => "192.168.0.1", :port => 10043)
server.on_request do |request, client|
  body = "{\"alloc_count\":163,...}"
  header = GQTP::Header.new
  header.query_type = GQTP::Header::ContentType::JSON
  header.flags = GQTP::Header::Flag::TAIL
  header.size = body.bytesize
  client.write(header.pack, body) do
    client.close
  end
end
server.run.wait

Proxy

proxy = GQTP::Proxy.new(:listen_host => "127.0.0.1",
                        :listen_port => 10043,
                        :upstream_host => "192.168.0.1",
                        :upstream_port => 10043)
proxy.run.wait

Dependencies

  • Ruby

Mailing list

Thanks

  • ...

Authors

License

LGPLv2.1 or later. See doc/text/lgpl-2.1.txt for details.

(Kouhei Sutou has a right to change the license including contributed patches.)