Прочти код внимательно
from collections import deque
class JobQueue:
def __init__(self):
self._q = deque()
def push(self, job):
self._q.append(job)
def pop(self):
return self._q.popleft() if self._q else None
q = JobQueue()
q.push("send_email:1") # job 1
q.push("send_email:2") # job 2
print(q.pop()) # drain 1 → first-in first-out
q.push("send_email:3") # job 3
q.push("send_email:4") # job 4
q.push("send_email:5") # job 5
# Transient failure on the next pop — retry policy puts it BACK
# on the END of the queue (FIFO order must hold).
failed = q.pop()
q.push(failed) # re-enqueued to the tail
# Drain everything remaining.
while True:
j = q.pop()
if j is None:
break
print(j)
# What does this print? Type your prediction.Что выведет программа? Напиши здесь: