Skip to content

Add task count limit to async produce #185

@rnowling-memphis

Description

@rnowling-memphis

The current async produce functionality will create as many async tasks as the user requests. We may want to implement a pattern like that described in the Python asyncio documentation to track all of the active async tasks with a loop to wait for the set to drain if it exceeds a given size. This would allow the user to avoid creating too many async tasks.

if len(background_tasks) >= UPPER_LIMIT:
    while len(background_tasks) >= LOWER_LIMIT:
        asyncio.sleep(0.1)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions