MCPcopy Index your code
hub / github.com/RustPython/RustPython / burst

Method burst

Lib/imaplib.py:1594–1614  ·  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

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

Callers 1

test_idle_burstMethod · 0.80

Calls 3

_popMethod · 0.95
nextFunction · 0.85
errorMethod · 0.45

Tested by 1

test_idle_burstMethod · 0.64