code: def set_handler(self, handler):
          
          if self._handler:
              raise Exception('Handler was already set')
          if handler:
              self._handler = async_task(handler, loop=self._loop)
docs: Connect with a coroutine, which is scheduled when connection is made.
  
          This function will create a task, and when connection is closed,
          the task will be canceled.
          :param handler:
          :return: None