opensergo-go-sdk
opensergo-go-sdk copied to clipboard
Support Context through all the lifecycle of OpenSergoClient
Issue Description
Type: feature request
Describe what feature you want
According to the characteristics of go language, We can control the all lifecycle of go-framwork by context
.
And we need to integrate the context
into OpenSergoClient, to make OpenSergoClient more flexible.
Through context
, we can manage lifecycle unified by realizing:
- receive context from upstream framework, use the
context
in OpenSergoClient self. - transfer context to downstream framework, do some special actions which OpenSergoClient owned before transfer
--
根据 go 的特性, 我们可以通过 context
上下文来控制 go框架的生命周期。这里,我们需要将context
集成到 OpenSergoClient 中,从而使 OpenSergoClient 变得更加灵活。
通过contex
上下文,我们可以实现以下两点来统一管理生命周期:
- 接收上游框架的
context
上下文, 将其集成到自身 - 在
context
中添加自己的信息以及操作,传递到下游框架
Additional context
The context
need to manage lifecycle of OpenSergoClient
and all goroutines OpenSergoClient created.
--
context
需要统一管理 OpenSergoClient 以及 OpenSergoClient 创建的所有 goroutine