original_docstring: Static callback to handle on_connect event
docstring: Static callback to handle on_connect event
docstring_tokens: Static callback to handle on_connect event
code: def on_connect(client, userdata, flags, return_code):
          """Static callback to handle on_connect event"""
          # Connection is successful with return_code: 0
          if return_code:
              userdata.connected.put_nowait(False)
              raise ConnectionError(return_code)
  
          # We subscribe to the status message
          client.subscribe(userdata.device_status)
          userdata.connected.put_nowait(True)
code_tokens: def on_connect ( client , userdata , flags , return_code ) : if return_code : userdata . connected . put_nowait ( False ) raise ConnectionError ( return_code ) client . subscribe ( userdata . device_status ) userdata . connected . put_nowait ( True )
short_docstring: Static callback to handle on_connect event
short_docstring_tokens: Static callback to handle on_connect event
comment: """Static callback to handle on_connect event"""$SEP$# Connection is successful with return_code: 0$SEP$# We subscribe to the status message