MCPcopy Index your code
hub / github.com/python/cpython / burst

Method burst

Lib/imaplib.py:1593–1613  ·  view source on GitHub ↗

Yield a burst of responses no more than 'interval' seconds apart. with M.idle() as idler: # get a response and any others following by < 0.1 seconds batch = list(idler.burst()) print(f'processing {len(batch)} responses...') print(batch)

(self, interval=0.1)

Source from the content-addressed store, hash-verified

1591 return typ, data
1592
1593 def burst(self, interval=0.1):
1594 """Yield a burst of responses no more than 'interval' seconds apart.
1595
1596 with M.idle() as idler:
1597 # get a response and any others following by < 0.1 seconds
1598 batch = list(idler.burst())
1599 print(f'processing {len(batch)} responses...')
1600 print(batch)
1601
1602 Note: This generator requires a socket connection (not IMAP4_stream).
1603 """
1604 if not self._imap.sock:
1605 raise self._imap.error('burst() requires a socket connection')
1606
1607 try:
1608 yield next(self)
1609 except StopIteration:
1610 return
1611
1612 while response := self._pop(interval, None):
1613 yield response
1614
1615
1616if HAVE_SSL:

Callers 1

test_idle_burstMethod · 0.80

Calls 2

_popMethod · 0.95
errorMethod · 0.45

Tested by 1

test_idle_burstMethod · 0.64