def connect(self):
if not self.connected():<EOL><INDENT>self._ws = create_connection(self.WS_URI)<EOL>message = {<EOL>'<STR_LIT:type>':self.WS_TYPE,<EOL>'<STR_LIT>':self.WS_PRODUCT_ID<EOL>}<EOL>self._ws.send(dumps(message))<EOL>with self._lock:<EOL><INDENT>if not self._thread:<EOL><INDENT>thread = Thread(target=self._keep_alive_thread, args=[])<EOL>thread.start()<EOL><DEDENT><DEDENT><DEDENT>
Connects and subscribes to the WebSocket Feed.