Browse Source

renamed shutdown to async_shutdown and sync_shutdown to shutdown

digital 7 years ago
parent
commit
feb8a53adf
1 changed files with 3 additions and 3 deletions
  1. 3 3
      network/__init__.py

+ 3 - 3
network/__init__.py

@@ -272,7 +272,7 @@ class Server(object):
         self.connection_handler = []
         # register our cleanup method to be executed when the program exits.
         # the cleanup function unregisters itself, so it won't get executed twice when the user called it befor the program exites
-        atexit.register(self.sync_shutdown)
+        atexit.register(self.shutdown)
 
     def make_socket(self):
         """
@@ -318,14 +318,14 @@ class Server(object):
             self.socket.bind(self.host)
         self.socket.listen(self.max_allowed_clients)
 
-    def sync_shutdown(self):
+    def shutdown(self):
         """
         this method can be called synchronous and calls the asynchronous
         shutdown method.
         """
         curio.run(self.shutdown)
 
-    async def shutdown(self):
+    async def async_shutdown(self):
         """
         This method properly shuts down the sockets and closes them.
         it unregisters itself from atexit, so it doesn't get executed twice