class Response
¶
-
class
tarantool.response.
Response
(conn, response)¶ Represents a single response from the server in compliance with the Tarantool protocol. Responsible for data encapsulation (i.e. received list of tuples) and parses binary packet received from the server.
Create an instance of Response using data received from the server.
__init__() itself reads data from the socket, parses response body and sets appropriate instance attributes.
Parameters: body (array of bytes) – body of the response -
count
(value) → integer -- return number of occurrences of value¶
-
data
¶ Type: object Required field in the server response. Contains list of tuples of SELECT, REPLACE and DELETE requests and arbitrary data for CALL.
-
index
(value) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
-
return_code
¶ Type: int Required field in the server response. Value of
return_code
can be0
if request was sucessfull or contains an error code. Ifreturn_code
is non-zero thanreturn_message
contains an error message.
-
return_message
¶ Type: str The error message returned by the server in case of
return_code
is non-zero.
-