Sha256: cc0febca33a099f72aee9685f9af319a0a319e0e115eba2ba004948367030576

Contents?: true

Size: 444 Bytes

Versions: 9

Compression:

Stored size: 444 Bytes

Contents

module EventMachine::Protocols::Memcache
  %w[delete get set].each do |type|
    module_eval %[
      alias :a#{type} :#{type}
      def #{type}(*params, &blk)
        f = Fiber.current
        self.a#{type}(*params) { |*cb_params| f.resume(*cb_params) }

        Fiber.yield
      end
    ]
  end

  alias :aget_hash :get_hash
  def get_hash(*keys)
    index = 0
    get(*keys).inject({}) { |h,v| h[keys[index]] = v; index += 1; h }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
em-synchrony-1.0.6 lib/em-synchrony/em-memcache.rb
em-synchrony-1.0.5 lib/em-synchrony/em-memcache.rb
em-synchrony-1.0.4 lib/em-synchrony/em-memcache.rb
em-synchrony-1.0.3 lib/em-synchrony/em-memcache.rb
em-synchrony-1.0.2 lib/em-synchrony/em-memcache.rb
em-synchrony-1.0.1 lib/em-synchrony/em-memcache.rb
em-synchrony-1.0.0 lib/em-synchrony/em-memcache.rb
em-synchrony-0.3.0.beta.1 lib/em-synchrony/em-memcache.rb
em-synchrony-0.2.0 lib/em-synchrony/em-memcache.rb