Skip to content

Commit

Permalink
docs(808): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hylexus committed Dec 1, 2024
1 parent 9aad016 commit 5accbe7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/.vuepress/sidebar/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const zhSidebar = sidebar({
children: [
'/v2/jt-808/guide/customization/netty-config.md',
'/v2/jt-808/guide/customization/codec-config.md',
'/v2/jt-808/guide/customization/custom-thread-pool.md',
'/v2/jt-808/guide/customization/session-config.md',
'/v2/jt-808/guide/customization/sub-package-config.md',
'/v2/jt-808/guide/customization/request-lifecycle-listener.md',
Expand Down
55 changes: 55 additions & 0 deletions docs/src/v2/jt-808/guide/customization/custom-thread-pool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
icon: change
---

# 业务线程池(v2.3.0-rc.2)

::: tip

业务线程池是 <Badge text="2.3.0-rc.2" type="tip" vertical="middle"/> 中新增的。

:::

## 配置内置业务线程池

```yaml
jt808:
# Netty 线程池
msg-processor:
executor-group:
thread-count: 2
pool-name: 808-msg-processer
max-pending-tasks: 128
## 业务线程池(指令服务器 和 附件服务器共用)
msg-handler:
enabled: true
core-pool-size: 64
max-pool-size: 128
keep-alive: 1m
max-pending-tasks: 256
daemon: true
pool-name: 808-handler
```
## 替换内置业务线程池
要替换内置的业务线程池,请提供一个 `Jt808ServerSchedulerFactory` 类型的 `Bean`。

```java
@Configuration
public class SomeConfigurationClass {
@Bean
Jt808ServerSchedulerFactory jt808ServerSchedulerFactory() {
return new Jt808ServerSchedulerFactory() {
@Override
public ExecutorService getMsgHandlerExecutor() {
// 这里返回自定义线程池
return null;
}
};
}
}
```
1 change: 1 addition & 0 deletions docs/src/v2/jt-808/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- 定制化
- [Netty相关](./customization/netty-config.md)
- [编码相关](./customization/codec-config.md)
- [业务线程池](./customization/custom-thread-pool.md)
- [Session相关](./customization/session-config.md)
- [分包相关](./customization/sub-package-config.md)
- [请求生存周期监听器](./customization/request-lifecycle-listener.md)
Expand Down

0 comments on commit 5accbe7

Please sign in to comment.