|
|
|
|
|
- Properties specific to redisResponse variables
- WLanguage functions that use the redisResponse type
redisResponse (Variable type) In french: redisRéponse
The redisResponse type makes it possible to define all the advanced characteristics of a response received by RedisExecuteCommand or RedisPipelineGet. The characteristics of this response can be known using different WLanguage properties. New in version 2025This type of variable can also be used to define the characteristics of a Valkey server response. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. INTERNAL PROCEDURE AfficheRésultat(r is redisResponse, sIdent="")
SWITCH r.Type
CASE redisTypeInt
Trace(sIdent + "entier : " + r.Integer)
CASE redisTypeError
Trace(sIdent + "erreur : " + r.String)
CASE redisTypeStatus
Trace(sIdent + "status : " + r.String)
CASE redisTypeNil
Trace(sIdent + "Nil")
CASE redisTypeArray
Trace(sIdent + "tableau : ")
FOR EACH r2 OF r.Array
AfficheReponse(r2, sIdent + TAB)
END
CASE redisTypeBuffer
Trace(sIdent + "buffer en chaine: " + r.String)
Trace(sIdent + "buffer en hexa: " + BufferToHexa(r.Buffer))
END
END
r1 is redisResponse = RedisExecuteCommand(gRedis, "GET cléString")
AfficheRésultat(r1)
Properties Properties specific to redisResponse variables The following properties can be used to manipulate a Redis response: | | | Property name | Type used | Effect |
---|
Array | Array of redisResponse | If the Type property is set to the redisTypeArray constant, this property contains an array of redisResponse variables. | Buffer | Buffer | Binary value if the Type property is set to the redisTypeBuffer constant. This property is read-only. | Integer | Integer | Integer value if the Type property is set to the redisTypeInt constant. This property is read-only. | String | Character string | - If the Type property is set to the redisTypeStatus constant, this property contains the string corresponding to the returned state.
- If the Type property is set to the redisTypeError constant, this property contains the error message.
- If the Type property is set to the redisTypeBuffer constant, this property contains the buffer converted to a string using UTF-8 encoding.
This property is read-only. | Type | Integer | Type of result. This type can correspond to one of the following constants: - redisTypeBuffer The result is a buffer.
- redisTypeInteger The result is an integer.
- redisTypeErreur The result corresponds to an error.
- redisTypeNil Result has no value.
- redisTypeStatus The result corresponds to a.
- redisTypeTableau: The result is an array.
This property is read-only. |
Remarks WLanguage functions that use the redisResponse type
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|