Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
6f2ca7f5
Commit
6f2ca7f5
authored
Sep 26, 2017
by
old-bear
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translate document combo_channel to English
parent
458430b1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
combo_channel.md
docs/cn/combo_channel.md
+4
-4
combo_channel.md
docs/en/combo_channel.md
+0
-0
No files found.
docs/cn/combo_channel.md
View file @
6f2ca7f5
...
@@ -17,9 +17,9 @@ ParallelChannel (“pchan”)同时访问其包含的sub channel,并合并它
...
@@ -17,9 +17,9 @@ ParallelChannel (“pchan”)同时访问其包含的sub channel,并合并它
示例代码见
[
example/parallel_echo_c++
](
https://github.com/brpc/brpc/tree/master/example/parallel_echo_c++/
)
。
示例代码见
[
example/parallel_echo_c++
](
https://github.com/brpc/brpc/tree/master/example/parallel_echo_c++/
)
。
任何brpc::ChannelBase的子类都可以加入ParallelChannel,包括ParallelChannel和其他组合Channel。用户可以设置ParallelChannelOptions.fail_limit来控制访问的最大失败次数
(r31803前是ParallelChannel::set_fail_limit)
,当失败的访问达到这个数目时,RPC call会立刻结束而不等待超时。
任何brpc::ChannelBase的子类都可以加入ParallelChannel,包括ParallelChannel和其他组合Channel。用户可以设置ParallelChannelOptions.fail_limit来控制访问的最大失败次数,当失败的访问达到这个数目时,RPC call会立刻结束而不等待超时。
当brpc >= 1.0.155.31351时,
一个sub channel可多次加入同一个ParallelChannel。当你需要对同一个服务发起多次异步访问并等待它们完成的话,这很有用。
一个sub channel可多次加入同一个ParallelChannel。当你需要对同一个服务发起多次异步访问并等待它们完成的话,这很有用。
ParallelChannel的内部结构大致如下:
ParallelChannel的内部结构大致如下:
...
@@ -36,13 +36,13 @@ int AddChannel(brpc::ChannelBase* sub_channel,
...
@@ -36,13 +36,13 @@ int AddChannel(brpc::ChannelBase* sub_channel,
ResponseMerger
*
response_merger
);
ResponseMerger
*
response_merger
);
```
```
当ownership为brpc::OWNS_CHANNEL时,sub_channel会在ParallelChannel析构时被删除。
当brpc >= 1.0.155.31351时,
由于一个sub channel可能会多次加入一个ParallelChannel,只要其中一个指明了ownership为brpc::OWNS_CHANNEL,那个sub channel就会在ParallelChannel析构时被删除(一次)。
当ownership为brpc::OWNS_CHANNEL时,sub_channel会在ParallelChannel析构时被删除。由于一个sub channel可能会多次加入一个ParallelChannel,只要其中一个指明了ownership为brpc::OWNS_CHANNEL,那个sub channel就会在ParallelChannel析构时被删除(一次)。
访问ParallelChannel时调用AddChannel是线程
**不安全**
的。
访问ParallelChannel时调用AddChannel是线程
**不安全**
的。
## CallMapper
## CallMapper
用于把对ParallelChannel的调用转化为对sub channel的调用。如果call_mapper是NULL,sub channel的请求就是ParallelChannel的请求,而response则New()自ParallelChannel的response。如果call_mapper不为NULL,则会在ParallelChannel析构时被删除。
当brpc >= 1.0.105.30846时,
call_mapper内含引用计数,一个call_mapper可与多个sub channel关联。
用于把对ParallelChannel的调用转化为对sub channel的调用。如果call_mapper是NULL,sub channel的请求就是ParallelChannel的请求,而response则New()自ParallelChannel的response。如果call_mapper不为NULL,则会在ParallelChannel析构时被删除。call_mapper内含引用计数,一个call_mapper可与多个sub channel关联。
```
c++
```
c++
class
CallMapper
{
class
CallMapper
{
...
...
docs/en/combo_channel.md
0 → 100644
View file @
6f2ca7f5
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment