Shutdown the server
(self, debug:bool=False)
| 91 | raise |
| 92 | |
| 93 | def shutdown(self, debug:bool=False) -> Literal[True]: |
| 94 | """Shutdown the server""" |
| 95 | # avoid showing traceback related to asyncore |
| 96 | self.was_shutdown = True |
| 97 | if not debug: |
| 98 | self.logger.setLevel(logging.FATAL) |
| 99 | while self._map: |
| 100 | triggers = list(self._map.values()) |
| 101 | for trigger in triggers: |
| 102 | trigger.handle_close() |
| 103 | self.maintenance(0) |
| 104 | self.task_dispatcher.shutdown() |
| 105 | return True |
| 106 | |
| 107 | @classmethod |
| 108 | def create(cls, application, **kwargs): |
no outgoing calls