From c323eb95e1cedad8c86ff5984e5dd0579a65760c Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Wed, 22 Oct 2025 06:57:23 +0000 Subject: [PATCH] Add README.md --- README.en.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..b0a095f --- /dev/null +++ b/README.en.md @@ -0,0 +1,69 @@ +# Dynamic Threadpool + +A dynamic threadpool component for simplifying the creation and management of thread pools, supporting configuration, monitoring, and dynamic adjustments. + +## Features + +- **Configurable Thread Pool**: Define thread pool parameters through configuration files. +- **Dynamic Adjustment**: Supports dynamic adjustment of thread pool configurations at runtime. +- **Monitoring**: Provides monitoring interfaces for thread pool runtime status. +- **Multiple Rejection Policies**: Supports various task rejection policies for thread pools. + +## Usage + +### Add Dependency + +Include the Dynamic Threadpool dependency in your `pom.xml` file: + +```xml + + com.zb + threadpool-jar + version-number + +``` + +### Configure Thread Pool + +Configure thread pool parameters in the `application.yml` or `application.properties` file: + +```yaml +dynamic: + thread-pool: + apolloNamespace: your-namespace + defaultQueueCapacity: 1000 + metricsEnabled: true +``` + +### Use Thread Pool + +You can execute tasks using `ThreadPoolUtils`: + +```java +ThreadPoolUtils.execute("your-pool-name", () -> { + // Your task code +}); +``` + +### Monitor Thread Pool + +Use `ThreadPoolStatusMonitor` to get the runtime status of the thread pool: + +```java +@Autowired +private ThreadPoolStatusMonitor statusMonitor; + +public void someMethod() { + Map status = statusMonitor.getThreadPoolRuntimeStatus("your-pool-name"); + // Process status information +} +``` + +## Module Description + +- **threadpool-jar**: Core module containing the implementation, configuration, monitoring, and other functionalities of the thread pool. +- **threadpool-test**: Test module used for testing thread pool functionalities. + +## License + +This project is licensed under the MIT License. For details, please refer to the LICENSE file in the project. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f7f8a8 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Dynamic Threadpool + +动态线程池组件,用于简化线程池的创建和管理,支持配置化、监控和动态调整。 + +## 特性 + +- **配置化线程池**:通过配置文件定义线程池参数。 +- **动态调整**:支持运行时动态调整线程池配置。 +- **监控功能**:提供线程池运行状态的监控接口。 +- **多种拒绝策略**:支持多种线程池任务拒绝策略。 + +## 使用说明 + +### 引入依赖 + +在你的 `pom.xml` 文件中引入 Dynamic Threadpool 的依赖: + +```xml + + com.zb + threadpool-jar + 版本号 + +``` + +### 配置线程池 + +在 `application.yml` 或 `application.properties` 文件中配置线程池参数: + +```yaml +dynamic: + thread-pool: + apolloNamespace: your-namespace + defaultQueueCapacity: 1000 + metricsEnabled: true +``` + +### 使用线程池 + +你可以通过 `ThreadPoolUtils` 来执行任务: + +```java +ThreadPoolUtils.execute("your-pool-name", () -> { + // 你的任务代码 +}); +``` + +### 监控线程池 + +通过 `ThreadPoolStatusMonitor` 获取线程池的运行状态: + +```java +@Autowired +private ThreadPoolStatusMonitor statusMonitor; + +public void someMethod() { + Map status = statusMonitor.getThreadPoolRuntimeStatus("your-pool-name"); + // 处理状态信息 +} +``` + +## 模块说明 + +- **threadpool-jar**:核心模块,包含线程池的实现、配置、监控等功能。 +- **threadpool-test**:测试模块,用于测试线程池的功能。 + +## 许可证 + +本项目采用 MIT 许可证。详情请查看项目中的 LICENSE 文件。 \ No newline at end of file -- Gitee