Gobrs-Async 快速入门

499 阅读1分钟

如何运行 Demo

克隆 Gobrs-Async 源代码

启动 Gobrs-Async-Example 模块下 GobrsAsyncExampleApplication 应用类

通过接口修改线程池中的配置。HTTP GET 路径:http://localhost:8888/gobrs/testGobrs,查看Idea 控制台 打印结果如下:

EService 成功
{"result":"我是EService 的 结果 恭喜你拿到"}
AService 执行完了
AService 成功
CService 成功
BService 成功
GService 成功
DService 成功
FService 成功
总耗时1563

配置文件

server:
  port: 8888
spring:
  gobrs:
    async:
      rules: '[{name: "test", content: "AService->BService,CService,GService,DService, FService:not;EService->FService"}]'
      #      rules: '[{name: "test", content: "BService->CService->EService->DService:not;AService->DService:not"}]'
      task-interrupt: true #局部异常是否打断主流程