[no ci] fix doc (#684)
This commit is contained in:
parent
ca8f1341bb
commit
2e5396cbc8
|
@ -54,3 +54,6 @@ node_modules
|
||||||
bazel-*
|
bazel-*
|
||||||
!BUILD.bazel
|
!BUILD.bazel
|
||||||
cdb.json
|
cdb.json
|
||||||
|
|
||||||
|
# website
|
||||||
|
website/docs/zh/*/images/
|
||||||
|
|
|
@ -23,7 +23,9 @@ export const struct_pack_Links = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const coro_rpc_Links = [
|
export const coro_rpc_Links = [
|
||||||
{text: 'What is coro_rpc?', link: '/en/coro_rpc/coro_rpc_introduction'},
|
{text: 'coro_rpc introduction', link: '/en/coro_rpc/coro_rpc_introduction'},
|
||||||
|
{text: 'coro_rpc client', link: '/en/coro_rpc/coro_rpc_client'},
|
||||||
|
{text: 'coro_rpc server', link: '/en/coro_rpc/coro_rpc_server'},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const aboutLinks = [
|
export const aboutLinks = [
|
||||||
|
|
|
@ -24,6 +24,8 @@ export const struct_pack_Links = [
|
||||||
|
|
||||||
export const coro_rpc_Links = [
|
export const coro_rpc_Links = [
|
||||||
{ text: 'coro_rpc简介', link: '/zh/coro_rpc/coro_rpc_introduction' },
|
{ text: 'coro_rpc简介', link: '/zh/coro_rpc/coro_rpc_introduction' },
|
||||||
|
{ text: 'coro_rpc客户端介绍', link: '/zh/coro_rpc/coro_rpc_client' },
|
||||||
|
{ text: 'coro_rpc服务端介绍', link: '/zh/coro_rpc/coro_rpc_server' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const easylog_Links = [
|
export const easylog_Links = [
|
||||||
|
|
|
@ -36,7 +36,7 @@ yarn install
|
||||||
- generate website
|
- generate website
|
||||||
|
|
||||||
```
|
```
|
||||||
bash gen_doc.sh
|
bash generate.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
the script will copy all markdown files and images to website folder
|
the script will copy all markdown files and images to website folder
|
||||||
|
|
|
@ -126,7 +126,7 @@ Lazy<int> calculate(int value) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Users can also use async_simple::Promise<T> to submit tasks to a custom thread pool:
|
Users can also use `async_simple::Promise<T>` to submit tasks to a custom thread pool:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using namespace async_simple::coro;
|
using namespace async_simple::coro;
|
||||||
|
@ -230,7 +230,7 @@ void echo(coro_rpc::context<std::string_view> ctx, std::string_view param) {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
It should be noted that view types in the RPC function parameters, such as std::string_view and std::span, will have their underlying data become invalid after all copies of the coro_rpc::context<T> object for this RPC call are destructed.
|
It should be noted that view types in the RPC function parameters, such as std::string_view and std::span, will have their underlying data become invalid after all copies of the `coro_rpc::context<T>` object for this RPC call are destructed.
|
||||||
|
|
||||||
### Calling Model
|
### Calling Model
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ void echo(coro_rpc::context<void> ctx) {
|
||||||
|
|
||||||
### Error Handling
|
### Error Handling
|
||||||
|
|
||||||
In callback functions, one should not and cannot return RPC errors by throwing exceptions, because the error might not occur within the call stack of the RPC function. Instead, we can use the coro_rpc::context<T>::response_error() function to return RPC errors.
|
In callback functions, one should not and cannot return RPC errors by throwing exceptions, because the error might not occur within the call stack of the RPC function. Instead, we can use the `coro_rpc::context<T>::response_error()` function to return RPC errors.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void echo(coro_rpc::context<void> ctx) {
|
void echo(coro_rpc::context<void> ctx) {
|
||||||
|
|
Loading…
Reference in New Issue