@synchronized(lock)<EOL><INDENT>def disconnect(self, connection):<DEDENT>
self.log.debug("<STR_LIT>" % connection)<EOL>if connection in self._pending:<EOL><INDENT>pending_frame = self._pending[connection]<EOL>self.store.requeue(pending_frame.headers.get(<EOL>'<STR_LIT>'), pending_frame)<EOL>del self._pending[connection]<EOL><DEDENT>for dest in list(self._queues.keys()):<EOL><INDENT>if connection in self._queues[dest]:<EOL><INDENT>self._queues[dest].remove(connection)<EOL><DEDENT>if not self._queues[dest]:<EOL><INDENT>del self._queues[dest]<EOL><DEDENT><DEDENT>
Removes a subscriber connection, ensuring that any pending commands get requeued.

@param connection: The client connection to unsubscribe.
@type connection: L{coilmq.server.StompConnection}