'Clears the callback attributes.
This allows the request handler to be garbage collected more
quickly in CPython by breaking up reference cycles.'

def _clear_callbacks(self):

    self._write_callback = None
    self._write_future = None
    self._close_callback = None
    if (self.stream is not None):
        self.stream.set_close_callback(None)
