terminate()

async Client.terminate()

Terminate the client by shutting down workers.

This method does the opposite of initialize(). It will stop the dispatcher and shut down updates and download workers.

Parameters:

clear_handlers (bool, optional) – Pass False to keep the registered handlers, so a later start reuses them. Defaults to True.

Returns:

None – The workers are stopped when it returns.

Raises:

ConnectionError – In case you try to terminate a client that is already terminated.