<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def maybe_get_next_message(self):
 """Pop the next message on the stack, adding a callback on the IOLoop to invoke the consumer with the message. This is done so we let the IOLoop perform any pending callbacks before trying to process the next message. """

        if self.pending:
            self.ioloop.add_callback(
                self.invoke_consumer, self.pending.popleft())