def is_starved(self):
for conn in itervalues(self.conns):<EOL><INDENT>if conn.in_flight > <NUM_LIT:0> and conn.in_flight >= (conn.last_rdy * <NUM_LIT>):<EOL><INDENT>return True<EOL><DEDENT><DEDENT>return False<EOL>
Used to identify when buffered messages should be processed and responded to.

When max_in_flight > 1 and you're batching messages together to perform work
is isn't possible to just compare the len of your list of buffered messages against
your configured max_in_flight (because max_in_flight may not be evenly divisible
by the number of producers you're connected to, ie. you might never get that many
messages... it's a *max*).

Example::

    def message_handler(self, nsq_msg, reader):
        # buffer messages
        if reader.is_starved():
            # perform work

    reader = nsq.Reader(...)
    reader.set_message_handler(functools.partial(message_handler, reader=reader))
    nsq.run()