python-slack-sdk icon indicating copy to clipboard operation
python-slack-sdk copied to clipboard

Let user configure blocking or not blocking websocket

Open drount opened this issue 11 years ago • 4 comments

  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                     

drount avatar Oct 22 '15 09:10 drount

:+1: on configurable, meanwhile,

sc = SlackClient(token)
sc.server.websocket.sock.setblocking(True)

seems to do the trick?

millerjs avatar Dec 18 '15 05:12 millerjs

@drount Are you still seeing this issue, and did @millerjs's suggestion not work out for you?

ajferrick avatar Sep 16 '16 00:09 ajferrick

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.

sasinda avatar Apr 16 '17 18:04 sasinda

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.

RodneyU215 avatar Apr 02 '19 05:04 RodneyU215