Sha256: 8f43b97633cb055d09573bb7439770bcd21a0bb295e4ec86b8975986097a5550
Contents?: true
Size: 868 Bytes
Versions: 1
Compression:
Stored size: 868 Bytes
Contents
module FFI module HiredisVip class Persist def initialize(client) @client = client end def persist(key) reply = nil command = "PERSIST %b" command_args = [ :pointer, key, :size_t, key.size ] synchronize do |connection| reply = @client.execute_command(connection, command, *command_args) end return nil if reply.nil? || reply.null? case reply[:type] when :REDIS_REPLY_INTEGER reply[:integer] end ensure ::FFI::HiredisVip::Core.freeReplyObject(reply.pointer) if reply end def supports_persist? true end private def synchronize @client.synchronize do |connection| yield(connection) end end end # class Persist end # module HiredisVip end # module FFI
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ffi-hiredis_vip-0.1.0.pre4 | lib/ffi/hiredis_vip/persist.rb |