|
|
|
|
- Properties specific to redisResponse variables
- WLanguage functions that use the redisResponse type
redisResponse (Type of variable) 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. Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. INTERNAL PROCEDURE DisplayResult (r is redisResponse, sIdent="")
SWITCH r.Type
CASE redisTypeInt
Trace(sIdent + "integer: " + r.Integer)
CASE redisTypeError
Trace(sIdent + "error: " + r.String)
CASE redisTypeStatus
Trace(sIdent + "status: " + r.String)
CASE redisTypeNil
Trace(sIdent + "Nil")
CASE redisTypeArray
Trace(sIdent + "array: ")
FOR EACH r2 OF r.Array
ShowResponse(r2, sIdent + TAB)
END
CASE redisTypeBuffer
Trace(sIdent + "buffer in string: " + r.String)
Trace(sIdent + "buffer in hexa: " + BufferToHexa(r.Buffer))
END
END
r1 is redisResponse = RedisExecuteCommand(gRedis, "GET keyString")
DisplayResult(r1)
Remarks 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 matches the redisTypeArray constant, this property contains an array of redisResponse variables. | Buffer | Buffer | Binary value if the Type property matches the redisTypeBuffer constant. This property is read-only. | Integer | Integer | Integer value if the Type property matches the redisTypeInt constant. This property is read-only. | String | Character string | - If the Type property matches the redisTypeStatus constant, this property contains the string corresponding to the returned state.
- If the Type property matches the redisTypeError constant, this property contains the error message.
- If the Type property matches 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 the result. This type can correspond to one of the following constants: - redisTypeBuffer: The result is a buffer.
- redisTypeInt: The result is an integer.
- redisTypeError: The result is an error.
- redisTypeNil: The result has no value.
- redisTypeStatus: The result is a status.
- redisTypeArray: The result is an array.
This property is read-only. |
WLanguage functions that use the redisResponse type
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|