indygreg / indygreg/python-zstandard

Feature request: first class asyncio support

Open
#215 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
642
Forks
116
Avg merge
1d 14h
Merged PRs (30d)
5

Description

The library already releases GIL so can be used with threading. It would be nice to have asyncio support as well, to avoid the need for all the extra threading layers for applications where that makes sense.

I'm imagining you would specify a thread pool size which zstd will use internally, akin to how you have a thread pool for the multithreaded compression option. Then the async compress/decompress methods would be run on that threadpool behind the scenes. So similar to how other async libraries work, where they might have a connection pool handling the async calls in the background.

At the very least, if there isn't support for async compression ops, there could be support for async reads/writes. E.g. where stream_writer feeds into aiofile.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the library's existing threading-based compression option and its stream read/write interfaces. Compare the proposed async compression methods and async I/O support, then define a concrete scope and API; done means one approach is selected with clear behavior for thread-pool sizing and asynchronous operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.