module Redis::Commands::Immediate

Overview

Immediate objects are ones that execute commands on the server and return their results immediately. This allows the caller to know that it can go to work on the results directly. The counterpart to this is the Deferred type.

client = Redis::Client.new
p! typeof(client.get("foo")) # => (String | Nil)
client.pipeline do |pipeline|
  p! typeof(pipeline.get("foo")) # => Redis::Future
end
client.multi do |txn|
  p! typeof(txn.get("foo")) # => Nil
end

Objects that include this mixin must return a Redis::Value from their run method. This mixin overrides various Redis command methods to downcast the return types to only the types that the Redis server is known to return.

Direct including types

Defined in:

commands/immediate.cr

Macro Summary

Macro Detail

macro set_return_types! #

[View source]