Module: EM::Tycoon

Defined in:
lib/em/tycoon.rb,
lib/em/tycoon/protocol/parser.rb,
lib/em/tycoon/protocol/message.rb,
lib/em/tycoon/protocol/binary/get_message.rb,
lib/em/tycoon/protocol/binary/set_message.rb,
lib/em/tycoon/protocol/binary/error_message.rb,
lib/em/tycoon/protocol/binary/remove_message.rb,
lib/em/tycoon/protocol/binary/play_script_message.rb

Overview

EventMachine Kyoto Tycoon Driver Uses Kyoto Tycoon’s binary protocol for increased efficiency (see “Binary Protocol” at fallabs.com/kyototycoon/spex.html#protocol) To get started:

tycoon = EM::Tycoon.connect(:host => 'localhost', :port => 1978)
tycoon.get("key1","key2","key3") do |results|
  results.each_pair { |k,v| puts "#{k} = #{v[:value]}" }
end

Defined Under Namespace

Modules: Protocol Classes: Client

Constant Summary collapse

DEFAULT_OPTS =
{:host => '127.0.0.1', :port => 1978}
REQUEST_TIMEOUT =

Timeout requests after 2 seconds

2

Class Method Summary collapse

Class Method Details

.connect(options = {}) ⇒ Object

Connect to a Kyoto Tycoon host, supported options are:

  • :host => host name or IP address of ktserver instance (default ‘127.0.0.1’)

  • :port => port ktserver is listening on (default 1978)



21
22
23
24
# File 'lib/em/tycoon.rb', line 21

def self.connect(options={})
  options = DEFAULT_OPTS.merge(options)
  EM.connect(options[:host], options[:port], Client)
end