-
Notifications
You must be signed in to change notification settings - Fork 81
Talking to darner from ruby memcache gems #14
Comments
I am not a ruby developer, but tried to talk to darner anyways as it seemed wierd it wouldnt work. # Gemfile
source 'https://rubygems.org'
gem 'memcache' # test.rb
require 'rubygems'
require 'bundler/setup'
require 'memcache'
cache = Memcache.new :server => 'localhost:22133'
cache.set 'ruby', 'this is the payload'
puts cache.get('ruby').inspect Running that through the cli ruby binary would output Tried with Dalli and couldnt get it to work. |
It definitely was weird to me. That gem is really old. I don't believe it has been updated in several years. memcached and dalli are probably the most widely used of late, I would guess. |
@jnunemaker it looks like dalli uses the newer memcached binary protocol: https://github.com/mperham/dalli#dalli-- Neither Darner nor Kestrel currently supports the binary protocol, but it makes a lot of sense to, and it's a pretty easy one to parse. But there's no reason why the kestrel client shouldn't work. I'll have a poke at that. |
I inspected kestrel-client and found it was sending gets with whitespace after the key, probably a side effect of supporting multiple keys. Darner now handles this as of 479b5ce - thanks @jnunemaker. To handle clients like dalli I've opened #15 - thanks for the sleuthing, guys. |
Awesome! Thanks for the fix. Can't wait to play around again. |
Tested with kestrel-client and memcached. works :) |
I've tried kestrel-client (build on top of memcached gem), the memcached gem and the dalli gem, and all fail to perform a get from darner.
For example, I start up darner:
Then start up irb, with dalli:
Same thing from the memcached gem:
set
seems to work for the memcached gem, but dalli always reports darner as dead. I also tried with the raw flag true, to avoid marshaling, but it still failed.I was able to use telnet just fine, so it seems to be something specific that the ruby gems need in the memcache protocol, but I'm not familiar enough. I can try to dig in, but I thought I would see if it is something obvious or easy that I am missing first.
I currently use kestrel with the kestrel-client gem no problem. I'd love to test out darner. Any ideas?
The text was updated successfully, but these errors were encountered: