Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support async send requests #1586

Open
zyguan opened this issue Feb 19, 2025 · 0 comments
Open

Support async send requests #1586

zyguan opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@zyguan
Copy link
Contributor

zyguan commented Feb 19, 2025

Currently, the KV client only provides synchronous API for sending requests. If a query needs to issue multiple requests concurrently, it inevitably has to create a new goroutine for each concurrent procedure. A typical scenario is batch-get, which groups keys into batches based on regions. When the number of batches exceeds one, a worker goroutine is created for each batch to send KV requests.

We aim to reduce the number of goroutines while still allowing requests to be issued concurrently as before. To achieve this, we need to introduce async API. In fact, the internal batch client processes requests and responses asynchronously through send loop and recv loop. It's not difficult to implement an async method for RPCClient, but rewriting upper layer in an async way require a significant amount of work. This issue tries to describe the brief work plan, it's also used to track related PRs.

Here is the related task breakdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants