def pending(self, partitions=None):
if partitions is None:<EOL><INDENT>partitions = self.offsets.keys()<EOL><DEDENT>total = <NUM_LIT:0><EOL>reqs = []<EOL>for partition in partitions:<EOL><INDENT>reqs.append(OffsetRequest(self.topic, partition, -<NUM_LIT:1>, <NUM_LIT:1>))<EOL><DEDENT>resps = self.client.send_offset_request(reqs)<EOL>for resp in resps:<EOL><INDENT>partition = resp.partition<EOL>pending = resp.offsets[<NUM_LIT:0>]<EOL>offset = self.offsets[partition]<EOL>total += pending - offset<EOL><DEDENT>return total<EOL>
Gets the pending message count

Keyword Arguments:
    partitions (list): list of partitions to check for, default is to check all