Sha256: 57c14faf424d4952f92ebda895f756ddaffba7c3f0543fe274e4ba0e250d7d22

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 Bytes

Contents

module Sinatra
  module MemcachedCommand
    def memcached_command options
      host = options[:host]
      port = options[:port]
      command = options[:command]

      memcached_connection = Net::Telnet::new("Host" => host, "Port" => port, "Timeout" => 3)
      memcached_connection.cmd("String" => command, "Match" => /^END/) do |response|
        return {response: response.inspect}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
memcached-manager-1.0.0 lib/extensions/memcached_command.rb