mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2024-12-22 22:16:38 +08:00
update format
This commit is contained in:
parent
711a5ed70c
commit
09367c9abb
@ -3,7 +3,7 @@
|
|||||||
> * Please reference tars_install.md
|
> * Please reference tars_install.md
|
||||||
|
|
||||||
2. How to quickly implement an example of a Tars C++?
|
2. How to quickly implement an example of a Tars C++?
|
||||||
> * For documentation, please refer to tars_cpp_quickstart.md, the relevant sample code, and the cpp/examples directory.
|
> * For documentation, please refer to tars_cpp_quickstart.md, the relevant sample code, and the examples directory.
|
||||||
|
|
||||||
3. What is the tars/tup protocol?
|
3. What is the tars/tup protocol?
|
||||||
> * For specific information, please refer to tars_tup.md.
|
> * For specific information, please refer to tars_tup.md.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Overview
|
## Overview
|
||||||
The TARS service framework only supports TARS's own tars protocol by default. However, in actual application scenarios, other protocols, such as HTTP, need to be supported in the TARS service framework. In this case, the communicator cannot be used to send data. The business itself need to implement this part of the code. For custom protocols, the processing is similar.
|
The TARS service framework only supports TARS's own tars protocol by default. However, in actual application scenarios, other protocols, such as HTTP, need to be supported in the TARS service framework. In this case, the communicator cannot be used to send data. The business itself need to implement this part of the code. For custom protocols, the processing is similar.
|
||||||
|
|
||||||
For specific program examples, see cpp/examples/httpDemo/.
|
For specific program examples, see examples/httpDemo/.
|
||||||
|
|
||||||
To develop a third-party protocol server end: you need to implement the protocol parser and load it into the service, and establish a non-TAF framework service object meanwhile, this class inherits from the Servant class and establishes the protocol processor by reloading the doRequest method in the Servant class.
|
To develop a third-party protocol server end: you need to implement the protocol parser and load it into the service, and establish a non-TAF framework service object meanwhile, this class inherits from the Servant class and establishes the protocol processor by reloading the doRequest method in the Servant class.
|
||||||
To access the service, the client needs to call the rpc function of proxy, before calling, set the request packet encoding function and the response packet decoding function for the proxy.
|
To access the service, the client needs to call the rpc function of proxy, before calling, set the request packet encoding function and the response packet decoding function for the proxy.
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Contents
|
# Contents
|
||||||
> * [1.Environment construction] (#main-chapter-1)
|
> * [1.Environment construction](#main-chapter-1)
|
||||||
> * [2.Service naming] (#main-chapter-2)
|
> * [2.Service naming](#main-chapter-2)
|
||||||
> * [3.Tars management system] (#main-chapter-3)
|
> * [3.Tars management system](#main-chapter-3)
|
||||||
> * [4.Service deployment] (#main-chapter-4)
|
> * [4.Service deployment](#main-chapter-4)
|
||||||
> * [5.Service development] (#main-chapter-5)
|
> * [5.Service development](#main-chapter-5)
|
||||||
> * [6.Service release] (#main-chapter-6)
|
> * [6.Service release](#main-chapter-6)
|
||||||
|
|
||||||
# 1. Environment construction <a id="main-chapter-1"></a>
|
# 1. Environment construction <a id="main-chapter-1"></a>
|
||||||
|
|
||||||
|
@ -729,7 +729,7 @@ Normally, B needs to return a response to A after B receives the request and fin
|
|||||||
Therefore, it is not can be implemented if B initiates an asynchronous request to C in the interface.
|
Therefore, it is not can be implemented if B initiates an asynchronous request to C in the interface.
|
||||||
|
|
||||||
Therefore, it is necessary to implemente the asynchronous calls across services by using the following methods.
|
Therefore, it is necessary to implemente the asynchronous calls across services by using the following methods.
|
||||||
You can see the cpp/examples/QuickStartDemo/ProxyServer example for details.
|
You can see the examples/QuickStartDemo/ProxyServer example for details.
|
||||||
|
|
||||||
The following still uses the helloworld program to explain. Firstly, the client initiates a request to the proxy, and the proxy initiates
|
The following still uses the helloworld program to explain. Firstly, the client initiates a request to the proxy, and the proxy initiates
|
||||||
testHello to the HelloServer asynchronously after receiving the request. Then the proxy returns the result by the HelloServer to the client
|
testHello to the HelloServer asynchronously after receiving the request. Then the proxy returns the result by the HelloServer to the client
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
In the actual application scenario, server-to-client push modes need to be supported in the TARS service framework.
|
In the actual application scenario, server-to-client push modes need to be supported in the TARS service framework.
|
||||||
|
|
||||||
For example, see cpp/examples/pushDemo/.
|
For example, see examples/pushDemo/.
|
||||||
|
|
||||||
## Flow chart of the push mode
|
## Flow chart of the push mode
|
||||||
Here's a flow chart of the push mode
|
Here's a flow chart of the push mode
|
||||||
|
BIN
docs/images/tars_flow.PNG
Normal file
BIN
docs/images/tars_flow.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
BIN
docs/images/tars_push_deploy.PNG
Normal file
BIN
docs/images/tars_push_deploy.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
BIN
docs/images/tars_result.PNG
Normal file
BIN
docs/images/tars_result.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
@ -3,7 +3,7 @@
|
|||||||
> * 参考tars_install.md
|
> * 参考tars_install.md
|
||||||
|
|
||||||
2. Tars C++如何快速上手?
|
2. Tars C++如何快速上手?
|
||||||
> * 文档参考tars_cpp_quickstart.md,相关示例代码参考cpp/examples目录
|
> * 文档参考tars_cpp_quickstart.md,相关示例代码参考examples目录
|
||||||
|
|
||||||
3. tars/tup协议是什么?
|
3. tars/tup协议是什么?
|
||||||
> * 具体参考tars_tup.md
|
> * 具体参考tars_tup.md
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## 概述
|
## 概述
|
||||||
TARS服务框架默认情况下只支持TARS自有的tars协议,但是在实际的应用场景中,需要在TARS服务框架中支持其他协议,例如HTTP,这种情况下就不能用通信器来发送据,需要业务自己来实现这部分代码。对于自定义的协议, 处理方式也类似
|
TARS服务框架默认情况下只支持TARS自有的tars协议,但是在实际的应用场景中,需要在TARS服务框架中支持其他协议,例如HTTP,这种情况下就不能用通信器来发送据,需要业务自己来实现这部分代码。对于自定义的协议, 处理方式也类似
|
||||||
|
|
||||||
具体程序示例,参见cpp/examples/httpDemo/.
|
具体程序示例,参见examples/httpDemo/.
|
||||||
|
|
||||||
开发第三方协议服务端,要实现协议解析器并将其加载到服务中,同时需要建立一个非TAF框架的服务对象,该类继承于Servant类,通过重载Servant类中的doRequest方法来建立协议处理器。
|
开发第三方协议服务端,要实现协议解析器并将其加载到服务中,同时需要建立一个非TAF框架的服务对象,该类继承于Servant类,通过重载Servant类中的doRequest方法来建立协议处理器。
|
||||||
而客户端要访问服务,需要通过调用proxy的rpc函数,在调用之前,要为proxy设置请求包编码函数和响应包解码函数。
|
而客户端要访问服务,需要通过调用proxy的rpc函数,在调用之前,要为proxy设置请求包编码函数和响应包解码函数。
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# 目录
|
# 目录
|
||||||
> * [1.环境搭建] (#main-chapter-1)
|
> * [1.环境搭建](#main-chapter-1)
|
||||||
> * [2.服务命名] (#main-chapter-2)
|
> * [2.服务命名](#main-chapter-2)
|
||||||
> * [3.Tars管理系统] (#main-chapter-3)
|
> * [3.Tars管理系统](#main-chapter-3)
|
||||||
> * [4.服务部署] (#main-chapter-4)
|
> * [4.服务部署](#main-chapter-4)
|
||||||
> * [5.服务开发] (#main-chapter-5)
|
> * [5.服务开发](#main-chapter-5)
|
||||||
> * [6.服务发布] (#main-chapter-6)
|
> * [6.服务发布](#main-chapter-6)
|
||||||
|
|
||||||
# 1. 环境搭建 <a id="main-chapter-1"></a>
|
# 1. 环境搭建 <a id="main-chapter-1"></a>
|
||||||
|
|
||||||
|
@ -729,7 +729,7 @@ QQInfo qi = pPrx->tars_hash(uin)->query(uin);
|
|||||||
|
|
||||||
通常情况下面,B接收到请求后,在接口处理完毕以后就需要返回应答给A,因此如果B在接口中又发起异步请求到C,则无法实现。
|
通常情况下面,B接收到请求后,在接口处理完毕以后就需要返回应答给A,因此如果B在接口中又发起异步请求到C,则无法实现。
|
||||||
|
|
||||||
因此需要采用下面方法实现跨服务的异步调用,具体可以参考cpp/examples/QuickStartDemo/ProxyServer示例。
|
因此需要采用下面方法实现跨服务的异步调用,具体可以参考examples/QuickStartDemo/ProxyServer示例。
|
||||||
|
|
||||||
还是采用hello world的例子,client发起请求给Proxy,Proxy接收到请求后,异步发起testHello给HelloServer,请求返回后,Proxy再将HelloServer返回的结果给client。
|
还是采用hello world的例子,client发起请求给Proxy,Proxy接收到请求后,异步发起testHello给HelloServer,请求返回后,Proxy再将HelloServer返回的结果给client。
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
但是在实际的应用场景中,需要在TARS服务框架中支持其他服务端到客户端的push模式
|
但是在实际的应用场景中,需要在TARS服务框架中支持其他服务端到客户端的push模式
|
||||||
|
|
||||||
具体程序示例,参见cpp/examples/pushDemo/.
|
具体程序示例,参见examples/pushDemo/.
|
||||||
|
|
||||||
## push模式的流程图
|
## push模式的流程图
|
||||||
下面是push模式的示意图
|
下面是push模式的示意图
|
||||||
|
Loading…
Reference in New Issue
Block a user