Method: Dalli::Client#quiet

Defined in:
lib/dalli/client.rb

#quietObject Also known as: multi

Turn on quiet aka noreply support for a number of memcached operations.

All relevant operations within this block will be effectively pipelined as Dalli will use ‘quiet’ versions. The invoked methods will all return nil, rather than their usual response. Method latency will be substantially lower, as the caller will not be blocking on responses.

Currently supports storage (set, add, replace, append, prepend), arithmetic (incr, decr), flush and delete operations. Use of unsupported operations inside a block will raise an error.

Any error replies will be discarded at the end of the block, and Dalli client methods invoked inside the block will not have return values



292
293
294
295
296
297
298
299
# File 'lib/dalli/client.rb', line 292

def quiet
  old = Thread.current[::Dalli::QUIET]
  Thread.current[::Dalli::QUIET] = true
  yield
ensure
  @ring&.pipeline_consume_and_ignore_responses
  Thread.current[::Dalli::QUIET] = old
end