class Dalli::Protocol::Base
def pipeline_next_responses(&block)
Without a block, returns a Hash of { key => [value, cas] }.
avoiding intermediate Hash allocation. Returns nil.
When a block is given, yields (key, value, cas) for each response,
#pipeline_complete?.
repeatedly whenever this server's socket is readable until
from this server. After #pipeline_response_setup, this should be invoked
Attempt to receive and parse as many key/value pairs as possible
def pipeline_next_responses(&block) reconnect_on_pipeline_complete! values = nil response_buffer.read status, cas, key, value = response_buffer.process_single_getk_response # status is not nil only if we have a full response to parse # in the buffer until status.nil? # If the status is ok and key is nil, then this is the response # to the noop at the end of the pipeline finish_pipeline && break if status && key.nil? # If the status is ok and the key is not nil, then this is a # getkq response with a value that we want to set in the response hash unless key.nil? if block yield key, value, cas else values ||= {} values[key] = [value, cas] end end # Get the next response from the buffer status, cas, key, value = response_buffer.process_single_getk_response end values || {} rescue SystemCallError, *TIMEOUT_ERRORS, *SSL_ERRORS, EOFError => e @connection_manager.error_on_request!(e) end