code: def run(self) -> None:
          
          self.main_task = self.loop.create_task(self.main())
          try:
              self.loop.run_until_complete(self.main_task)
          except asyncio.CancelledError:
              # happens on shutdown, fine
              pass
          finally:
              self.loop.run_until_complete(self.close())
docs: Sync function to run the worker, finally closes worker connections.