kopia lustrzana https://github.com/micropython/micropython-lib
uasyncio: Add awriteiter() method.
Write piecewise content from iterable (usually, a generator).pull/188/head
rodzic
1096940769
commit
a191626c2e
|
@ -171,6 +171,11 @@ class StreamWriter:
|
|||
if DEBUG and __debug__:
|
||||
log.debug("StreamWriter.awrite(): can write more")
|
||||
|
||||
# Write piecewise content from iterable (usually, a generator)
|
||||
def awriteiter(self, iterable):
|
||||
for buf in iterable:
|
||||
yield from self.awrite(buf)
|
||||
|
||||
def aclose(self):
|
||||
yield IOWriteDone(self.s)
|
||||
self.s.close()
|
||||
|
|
Ładowanie…
Reference in New Issue