class_docstr: Implements the HTTP/1.x protocol.
  
  This class can be on its own for clients, or via `HTTP1ServerConnection`
  for servers.
class_docstr_tok: ["Implements","the","HTTP\/1.x","protocol",".","This","class","can","be","on","its","own","for","clients",",","or","via","`","HTTP1ServerConnection","`","for","servers","."]
docstr: Sets a callback that will be run when the connection is closed.
  
  Note that this callback is slightly different from
  `.HTTPMessageDelegate.on_connection_close`: The
  `.HTTPMessageDelegate` method is called when the connection is
  closed while receiving a message. This callback is used when
  there is not an active delegate (for example, on the server
  side this callback is used if the client closes the connection
  after sending its request but before receiving all the
  response.
code: def set_close_callback(
      self, callback: Optional[Callable[[], None]]
  ) -> None:
      """Sets a callback that will be run when the connection is closed.
  
      Note that this callback is slightly different from
      `.HTTPMessageDelegate.on_connection_close`: The
      `.HTTPMessageDelegate` method is called when the connection is
      closed while receiving a message. This callback is used when
      there is not an active delegate (for example, on the server
      side this callback is used if the client closes the connection
      after sending its request but before receiving all the
      response.
      """
      self._close_callback = callback
  
imports: import asyncio
  import logging
  import re
  import types
  from tornado.concurrent import Future, future_add_done_callback, future_set_result_unless_cancelled
  from tornado.escape import native_str, utf8
  from tornado import gen
  from tornado import httputil
  from tornado import iostream
  from tornado.log import gen_log, app_log
  from tornado.util import GzipDecompressor
  from typing import cast, Optional, Type, Awaitable, Callable, Union, Tuple
label_desc: Use image node_id 4 for calling the HTTP1Connection obj's underlying member method code with example usage: obj.set_close_callback(callback) without return types