Method: Redis#monitor

Defined in:
lib/redis.rb

#monitor {|line| ... } ⇒ Object

Listen for all requests received by the server in real time.

There is no way to interrupt this command.

Yields:

  • a block to be called for every line of output

Yield Parameters:

  • line (String)

    timestamp and command that was executed



221
222
223
224
225
# File 'lib/redis.rb', line 221

def monitor(&block)
  synchronize do |client|
    client.call_loop([:monitor], &block)
  end
end