async def unsubscribe(self):
await self._nc.unsubscribe(self.sid)<EOL>try:<EOL><INDENT>sub = self._sc._sub_map[self.inbox]<EOL>sub._msgs_task.cancel()<EOL>del self._sc._sub_map[self.inbox]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>req = protocol.UnsubscribeRequest()<EOL>req.clientID = self._sc._client_id<EOL>req.subject = self.subject<EOL>req.inbox = self.ack_inbox<EOL>if self.durable_name is not None:<EOL><INDENT>req.durableName = self.durable_name<EOL><DEDENT>msg = await self._nc.request(<EOL>self._sc._unsub_req_subject,<EOL>req.SerializeToString(),<EOL>self._sc._connect_timeout,<EOL>)<EOL>resp = protocol.SubscriptionResponse()<EOL>resp.ParseFromString(msg.data)<EOL>if resp.error != "<STR_LIT>":<EOL><INDENT>raise StanError(resp.error)<EOL><DEDENT>
Remove subscription on a topic in this client.