[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-04-16 Thread Andrey Paramonov
Andrey Paramonov added the comment: Hello! Below is updated implementation containing more consistent error handling. The main rough edges encountered: 1. asyncio.Queue alone proved insufficient for precise control of limit, as asyncio.create_task() schedules created Task() immediately and

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-02-25 Thread Andrey Paramonov
Andrey Paramonov added the comment: > an implicit requirement that back pressure from the consumer should be > handled (i.e. if whoever's iterating through "async for fut in > as_completed(...)" is too slow, then the tasks should pause until it catches > u

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-02-21 Thread Andrey Paramonov
Andrey Paramonov added the comment: Might as_completed() be considered a low-level API, but as of Python 3.7 there are seemingly no ready alternatives to achieve proposed behavior. All of asyncio.gather(), asyncio.wait(), asyncio.as_completed() expect awaitables list of limited size; doing

[issue34905] Cannot assign memoryview values from array.array

2018-10-05 Thread Andrey Paramonov
New submission from Andrey Paramonov : Currently, memoryview values can be assigned from all bytes-like objects (https://docs.python.org/3/glossary.html#term-bytes-like-object) except byte array.array: import array mview = memoryview(bytearray(b'hello')) mview[:] = byt