Let user configure blocking or not blocking websocket
def connect_slack_websocket(self, ws_url):
try:
self.websocket = create_connection(ws_url)
self.websocket.sock.setblocking(0) #<---- make this configurable
except:
raise SlackConnectionError
:+1: on configurable, meanwhile,
sc = SlackClient(token)
sc.server.websocket.sock.setblocking(True)
seems to do the trick?
@drount Are you still seeing this issue, and did @millerjs's suggestion not work out for you?
sc.server.websocket.sock.setblocking(True), works. I was about to put the same issue again and noticed it was already there. Anyway, it would be nice to have a config in the rtm_read method. Also, an option to register a callback to run on response ready.
This issue has been resolved with the work around posted above. Due to a dependency change in v2 I'm closing this issue as we will not adding any new client specific enhancements for this version. For more details around this please see https://github.com/slackapi/python-slackclient/issues/384#issuecomment-478200554.