Class: Oxblood::Session
- Inherits:
-
Object
- Object
- Oxblood::Session
- Includes:
- Commands
- Defined in:
- lib/oxblood/session.rb
Overview
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(connection) ⇒ Session
constructor
A new instance of Session.
-
#pipelined {|pipeline| ... } ⇒ Object
Send queries using pipelining.
-
#run_command(*command) ⇒ Object
Send command to Redis server and read response from it.
Methods included from Commands::Transactions
#discard, #exec, #multi, #unwatch, #watch
Methods included from Commands::SortedSets
#zadd, #zcard, #zcount, #zincrby, #zinterstore, #zlexcount, #zrange, #zrangebylex, #zrangebyscore, #zrank, #zrem, #zremrangebylex, #zremrangebyrank, #zremrangebyscore, #zrevrange, #zrevrangebylex, #zrevrangebyscore, #zrevrank, #zscan, #zscore, #zunionstore
Methods included from Commands::Scripting
#eval, #evalsha, #script_debug, #script_exists, #script_flush, #script_kill, #script_load
Methods included from Commands::Sets
#sadd, #scard, #sdiff, #sdiffstore, #sinter, #sinterstore, #sismember, #smembers, #smove, #spop, #srandmember, #srem, #sscan, #sunion, #sunionstore
Methods included from Commands::Lists
#blpop, #brpop, #brpoplpush, #lindex, #linsert, #llen, #lpop, #lpush, #lpushx, #lrange, #lrem, #lset, #ltrim, #rpop, #rpoplpush, #rpush, #rpushx
Methods included from Commands::Keys
#del, #dump, #exists, #expire, #expireat, #keys, #move, #object, #persist, #pexpire, #pexpireat, #pttl, #randomkey, #rename, #renamenx, #restore, #scan, #ttl, #type
Methods included from Commands::Server
#bgrewriteaof, #bgsave, #client_getname, #client_kill, #client_list, #client_pause, #client_setname, #command, #command_count, #command_getkeys, #command_info, #config_get, #config_resetstat, #config_rewrite, #config_set, #dbsize, #flushall, #flushdb, #info, #lastsave, #role, #save, #shutdown, #slaveof, #slowlog, #time
Methods included from Commands::Geo
#geoadd, #geodist, #geohash, #geopos, #georadius, #georadiusbymember
Methods included from Commands::Connection
#auth, #echo, #ping, #quit, #select
Methods included from Commands::Strings
#append, #bitcount, #bitop, #bitpos, #decr, #decrby, #get, #getbit, #getrange, #getset, #incr, #incrby, #incrbyfloat, #mget, #mset, #msetnx, #psetex, #set, #setbit, #setex, #setnx, #setrange, #strlen
Methods included from Commands::HyperLogLog
Methods included from Commands::Hashes
#hdel, #hexists, #hget, #hgetall, #hincrby, #hincrbyfloat, #hkeys, #hlen, #hmget, #hmset, #hscan, #hset, #hsetnx, #hstrlen, #hvals
Constructor Details
#initialize(connection) ⇒ Session
Returns a new instance of Session.
20 21 22 |
# File 'lib/oxblood/session.rb', line 20 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
18 19 20 |
# File 'lib/oxblood/session.rb', line 18 def connection @connection end |
Instance Method Details
#pipelined {|pipeline| ... } ⇒ Object
Send queries using pipelining. Sync operation will be executed automatically at the end of a block.
38 39 40 41 42 |
# File 'lib/oxblood/session.rb', line 38 def pipelined pipeline = Pipeline.new(connection) yield pipeline pipeline.sync end |
#run_command(*command) ⇒ Object
Send command to Redis server and read response from it. Useful for executing unimplemented in adapter Redis commands.
51 52 53 |
# File 'lib/oxblood/session.rb', line 51 def run_command(*command) connection.run_command(*command) end |