apache / apache/brpc

能否将rq视作一个unbounded队列,来对请求进行缓存处理

Open
#2,701 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
代码如下,业务需求是:rpc提前返回给上游,然后server读执行后续的耗时操作(落盘)。
![image](https://github.com/user-attachments/assets/9c3bd1eb-ddd5-48a4-8401-9b344b64e385)

**Describe the solution you'd like (描述你期望的解决方法)**
1、我能否将brpc的rq视作一个mpmc的队列,这样就不用在回调中入队,后台消费线程出队?
2、如果可以,能否在done->Run()之后,“用户的耗时操作”之前,利用令牌桶进行控速

**Describe alternatives you've considered (描述你想到的折衷方案)**

**Additional context/screenshots (更多上下文/截图)**

Contributor guide

Open the contributing guide

Research direction

The issue names brpc's rq, the done->Run() callback, and a token-bucket limiter, but no files or tests. Start by tracing rq and the RPC callback lifecycle to determine whether rq provides the requested MPMC and unbounded-queue behavior. Done should be a documented design decision, with implementation and tests only if the project accepts the proposed request-processing model.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
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.