deepgram / deepgram-python-sdk

Official Python SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
178 stars 48 forks source link

Unhandled exceptions in AsyncLiveClient._listening #356

Closed roerohan closed 2 months ago

roerohan commented 2 months ago

What is the current behavior?

An unhandled exception occurs in _listening in AsyncLiveClient which cause the _listening thread to error out with an error Task exception was not retrieved. The issue is described in #355 in detail.

Steps to reproduce

Open a connection with deepgram, don't send any packets for a while until self._socket.recv() errors out (as deepgram closes the connection).

Expected behavior

The _listening thread should ideally recover, of there should be a connection closed event, which the user can listen to to establish a new connection

Please tell us about your environment

Operating System/Version: Linux 6.6.19-1-MANJARO Python Version: 3.11.8

Other information

roerohan commented 2 months ago

I've made a part of the change in #355 , please take a look