opensergo-go-sdk icon indicating copy to clipboard operation
opensergo-go-sdk copied to clipboard

Support Context through all the lifecycle of OpenSergoClient

Open jnan806 opened this issue 2 years ago • 0 comments

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

jnan806 avatar Nov 22 '22 13:11 jnan806