OSHiredisContext
Description
A concrete subclass of <OSHiredisStructure> that maps to the redisContext C struct. An instance of this class represents the state of a single connection to the Redis server. It holds information such as the file descriptor, error flags, and buffers for reading and writing.
Class Methods
connectWithOptions:
  Connect to a Redis server using the specified options and answer a new,
     connected instance.
     
     Arguments:
        anOSHiredisOptions - <OSHiredisOptions> The C structure with connection options.
     Answers:
        <OSHiredisContext> A new instance representing the connection.
     Raises:
        <EsRedisException> If the connection fails.
Instance Methods
command:as:
  Execute a command and wait for the reply.
     
     Arguments:
        aStringOrSequenceableCollection - <String | SequenceableCollection> The command to execute.
        aContainerClass - <Class> The desired container for the reply.
     Answers:
        <Object> The processed reply from Redis.
getReplies:withConverters:
  Private - Collect a specific number of replies from the server, applying the
     correct container type to each from the queued converters.
getReply:
  Read and process a single pending reply from the server.
     This is intended for use after a pipeline of commands has been sent.
     
     Arguments:
        aContainerClass - <Class> The desired container for the reply.
     Answers:
        <Object> The processed reply from Redis.
     Raises:
        <EsRedisException> If getting the reply fails or the reply is invalid.
isConnected
  Answer true if the context has an active and valid connection.
     
     Answers:
        <Boolean>
isSecure
  Hiredis context is not secure in our binding
     
     Answers:
        <Boolean>
pipelineAppend:
  Append a command to the output buffer for pipelining.
     This method does not wait for a reply.
     
     Arguments:
        aStringOrSequenceableCollection - <String | SequenceableCollection> The command to append.
     Raises:
        <EsRedisException> If appending the command fails.
processReply:as:
  Private - Process the reply. This method passes the receiver (the context)
     along with the reply object, so that the reply processing logic can access
     client-specific settings when needed.
reconnect
  Attempt to reconnect to the server using the same host, port, and
     options. This can be useful after a connection has been lost.
    
     Answers:
        <OSHiredisContext> The receiver if the reconnect is successful.
     Raises:
        <EsRedisException> If the reconnect fails.
sendCommandForTransactionAsync:
  Append a command to the output buffer and answer a future for its reply.
     This method is for internal async use by EsRedisPipeline and EsRedisTransaction.
    
     Arguments:
        aStringOrSequenceableCollection - <String | SequenceableCollection> The command.
     Answers:
        <EsFuture> A future that will complete with the command's result.
Last modified date: 01/22/2026