13 lines
229 B
Python
13 lines
229 B
Python
|
class MessageQueue:
|
||
|
|
||
|
messages = []
|
||
|
|
||
|
def append(self, message):
|
||
|
self.messages.append(message)
|
||
|
|
||
|
def shift(self):
|
||
|
return self.messages.pop(0)
|
||
|
|
||
|
def pending(self):
|
||
|
return len(self.messages) > 0
|