Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
willzhen committed Jan 5, 2023
1 parent 4a33b77 commit 6174239
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions task_scheduler/readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
- [轻量级任务调度框架](#轻量级任务调度框架)
- [框架的设计思想和背景](#框架的设计思想和背景)
- [任务系统的整体设计](#任务系统的整体设计)
- [任务调度框架](#任务调度框架)
- [任务容器分类](#任务容器分类)
- [1. 同步任务和异步任务](#1-同步任务和异步任务)
- [2. 可持久任务和不可持久化任务](#2-可持久任务和不可持久化任务)
- [Usage](#usage)
- [使用内存容器实现 a+b 任务调度](#使用内存容器实现-ab-任务调度)
- [实现 a+b 任务执行器](#实现-ab-任务执行器)
- [实现 a+b 任务容器](#实现-ab-任务容器)
- [实现调度](#实现调度)

# 轻量级任务调度框架

## 框架的设计思想和背景
Expand Down Expand Up @@ -47,10 +60,10 @@

任务根据不同的维度,任务可以分成

#### 同步任务和异步任务
#### 1. 同步任务和异步任务
本框架主要实现了任务异步化,可以轻易的通过执行器的实现把同步任务转换成异步任务。注意:实现同步任务执行器的时候,不要阻塞 Start 方法,而是在单独的协程执行任务。

#### 可持久任务和不可持久化任务
#### 2. 可持久任务和不可持久化任务
任务的是否可持久化,通俗来说,就是任务执行完成以后,是否还能查询到任务相关的信息和记录。

1. 不可持久化任务——比如存储在内存队列里面的任务,执行完成以后,或者服务宕机、重启以后,任务相关的数据消失,无迹可寻。
Expand All @@ -71,7 +84,7 @@
由于 MemeoryContainer 和 PersistContainer 各有优缺点,如果可以组合两种容器,生成一种新的任务容器[combinationContainer](https://github.com/memory-overflow/go-common-library/blob/main/task_scheduler/container/combination_container.go),既能够通过内存实现快写快读,又能够通过DB实现可持久化。
![image](https://user-images.githubusercontent.com/15645203/210742391-ae2c60ac-9f19-4d1a-947b-634e3a3855ef.png)

## usage
## Usage

### 使用内存容器实现 a+b 任务调度

Expand Down

0 comments on commit 6174239

Please sign in to comment.