Add restart method
This commit is contained in:
parent
19b8f648d2
commit
07276e31b9
@ -13,6 +13,7 @@ Utilities
|
||||
|
||||
start
|
||||
stop
|
||||
restart
|
||||
idle
|
||||
run
|
||||
add_handler
|
||||
|
@ -374,6 +374,16 @@ class Client(Methods, BaseClient):
|
||||
|
||||
return self
|
||||
|
||||
def restart(self):
|
||||
"""Use this method to restart the Client.
|
||||
Requires no parameters.
|
||||
|
||||
Raises:
|
||||
``ConnectionError`` in case you try to restart a stopped Client.
|
||||
"""
|
||||
self.stop()
|
||||
self.start()
|
||||
|
||||
def idle(self, stop_signals: tuple = (SIGINT, SIGTERM, SIGABRT)):
|
||||
"""Blocks the program execution until one of the signals are received,
|
||||
then gently stop the Client by closing the underlying connection.
|
||||
|
Loading…
Reference in New Issue
Block a user