lib/ffi/hiredis_vip/set.rb in ffi-hiredis_vip-0.1.0.pre1 vs lib/ffi/hiredis_vip/set.rb in ffi-hiredis_vip-0.1.0.pre2
- old
+ new
@@ -10,10 +10,11 @@
end
def set(key, value, options = {})
reply = nil
command = "SET %b %b"
+ value = value.to_s
command_args = [ :string, key, :size_t, key.size, :string, value, :size_t, value.size ]
if options[:ex]
expiry = "#{options[:ex]}"
command << " EX %b"
@@ -28,10 +29,10 @@
command << " NX" if options[:nx]
command << " XX" if options[:xx]
synchronize do |connection|
- reply = ::FFI::HiredisVip::Core.command(connection, command, *command_args)
+ reply = @client.execute_command(connection, command, *command_args)
end
return nil if reply.nil? || reply.null?
case reply[:type]