class Response

class tarantool.response.Response(conn, header, body, space_name=None, field_defs=None, default_type=None)

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:
  • header (array of bytes) – header of the response
  • body (array of bytes) – body of the response
completion_status
Type :int

Request completion status.

There are only three completion status codes in use:

  • 0 – “success”; the only possible return_code with

    this status is 0

  • 1 – “try again”; an indicator of an intermittent error.

    This status is handled automatically by this module.

  • 2 – “error”; in this case return_code holds

    the actual error.

return_code
Type :int

Required field in the server response. Value of return_code can be 0 if request was sucessfull or contains an error code. If return_code is non-zero than return_message contains an error message.

return_message
Type :str

The error message returned by the server in case of return_code is non-zero.

rowcount
Type :int

Number of rows affected or returned by a query.

Previous topic

class Space

This Page