Connection API

Warning: this class is not public, it appears here just to document some kwargs. Do not use directly.

class tornadis.Connection(read_callback, close_callback, host='127.0.0.1', port=6379, unix_domain_socket=None, read_page_size=65536, write_page_size=65536, connect_timeout=20, tcp_nodelay=False, aggressive_write=False, read_timeout=0, ioloop=None)

Low level connection object.

Variables:
  • host (string) – the host name to connect to.
  • port (int) – the port to connect to.
  • unix_domain_socket (string) – path to a unix socket to connect to (if set, overrides host/port parameters).
  • read_page_size (int) – page size for reading.
  • write_page_size (int) – page size for writing.
  • connect_timeout (int) – timeout (in seconds) for connecting.
  • tcp_nodelay (boolean) – set TCP_NODELAY on socket.
  • aggressive_write (boolean) – try to minimize write latency over global throughput (default False).
  • read_timeout (int) – timeout (in seconds) to read something on the socket (if nothing is read during this time, the connection is closed) (default: 0 means no timeout)
__init__(read_callback, close_callback, host='127.0.0.1', port=6379, unix_domain_socket=None, read_page_size=65536, write_page_size=65536, connect_timeout=20, tcp_nodelay=False, aggressive_write=False, read_timeout=0, ioloop=None)

Constructor.

Parameters:
  • read_callback – callback called when there is something to read (private, do not use from Client constructor).
  • close_callback – callback called when the connection is closed (private, do not use from Client constructor).
  • host (string) – the host name to connect to.
  • port (int) – the port to connect to.
  • unix_domain_socket (string) – path to a unix socket to connect to (if set, overrides host/port parameters).
  • read_page_size (int) – page size for reading.
  • write_page_size (int) – page size for writing.
  • connect_timeout (int) – timeout (in seconds) for connecting.
  • tcp_nodelay (boolean) – set TCP_NODELAY on socket.
  • aggressive_write (boolean) – try to minimize write latency over global throughput (default False).
  • read_timeout (int) – timeout (in seconds) to read something on the socket (if nothing is read during this time, the connection is closed) (default: 0 means no timeout)
  • ioloop (IOLoop) – the tornado ioloop to use.