def _send_backlog(self, connection, destination=None):
if destination is None:<EOL><INDENT>eligible_queues = dict([(dest, q) for (dest, q) in self._queues.items()<EOL>if connection in q and self.store.has_frames(dest)])<EOL>destination = self.queue_scheduler.choice(<EOL>eligible_queues, connection)<EOL>if destination is None:<EOL><INDENT>self.log.debug(<EOL>"<STR_LIT>" % connection)<EOL>return<EOL><DEDENT><DEDENT>self.log.debug("<STR_LIT>" %<EOL>(connection, destination))<EOL>if connection.reliable_subscriber:<EOL><INDENT>frame = self.store.dequeue(destination)<EOL>if frame:<EOL><INDENT>try:<EOL><INDENT>self._send_frame(connection, frame)<EOL><DEDENT>except Exception as x:<EOL><INDENT>self.log.error(<EOL>"<STR_LIT>" % (frame, x))<EOL>self.store.requeue(destination, frame)<EOL>raise<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for frame in self.store.frames(destination):<EOL><INDENT>try:<EOL><INDENT>self._send_frame(connection, frame)<EOL><DEDENT>except Exception as x:<EOL><INDENT>self.log.error(<EOL>"<STR_LIT>" % (frame, x))<EOL>self.store.requeue(destination, frame)<EOL>raise<EOL><DEDENT><DEDENT><DEDENT>
Sends any queued-up messages for the (optionally) specified destination to connection.

If the destination is not provided, a destination is chosen using the 
L{QueueManager.queue_scheduler} scheduler algorithm.

(This method assumes it is being called from within a lock-guarded public
method.)  

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

@param destination: The topic/queue destination (e.g. '/queue/foo')
@type destination: C{str} 

@raise Exception: if the underlying connection object raises an error, the message
                    will be re-queued and the error will be re-raised.