def _send_request(self, method, params=[], is_subscribe = False):
<EOL>self.next_id += <NUM_LIT:1><EOL>req_id = self.next_id<EOL>msg = {'<STR_LIT:id>': req_id, '<STR_LIT>': method, '<STR_LIT>': params}<EOL>if is_subscribe:<EOL><INDENT>waitQ = asyncio.Queue()<EOL>self.subscriptions[method].append(waitQ)<EOL><DEDENT>fut = asyncio.Future(loop=self.loop)<EOL>self.inflight[req_id] = (msg, fut)<EOL>if not self.protocol:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>async def connect_first():<EOL><INDENT>await self.reconnect()<EOL>self.protocol.send_data(msg)<EOL><DEDENT>self.loop.create_task(connect_first())<EOL><DEDENT>else:<EOL><INDENT>self.protocol.send_data(msg)<EOL><DEDENT>return fut if not is_subscribe else (fut, waitQ)<EOL>
Send a new request to the server. Serialized the JSON and
tracks id numbers and optional callbacks.