Project

em-tycoon

0.0
No commit activity in last 3 years
No release in over 3 years
An async client for Kyoto Tycoon's binary protocol using EventMachine
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

em_tycoon¶ ↑

An async client for Kyoto Tycoon (fallabs.com/kyototycoon/) using EventMachine

Overview¶ ↑

em_tycoon uses Kyoto Tycoon’s binary protocol (see fallabs.com/kyototycoon/spex.html#protocol) for increased efficiency, it does not currently implement any of the commands available outside of that protocol. This means you are currently limited to:

  • get_bulk

  • set_bulk

  • remove_bulk

  • play_script

Quick start¶ ↑

require ‘em-tycoon’ EM.run do tycoon = EM::Tycoon.connect(:host => ‘localhost’, :port => 1978) # The second key will expire after 24 hours tycoon.set(“key1” => “value1”, “key_with_xt” => {:value => “value2”, :xt => (Time.now+86400)}) do |set_result| unless set_result.nil? puts “Set #{set_result} keys” tycoon.get(“key1”,“key_with_xt”) do |get_result| get_result.each_pair do |key,value| puts “Got #{key} = #{value} with expiration time : #{value || ‘None’}” end end else puts “Error!” end end end

Copyright © 2011 Chris Ingrassia. See LICENSE for details.