-
Notifications
You must be signed in to change notification settings - Fork 41
realloc: Send Error to channel instead of boolean success. #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
有一个奇异的想法, 因为 errCh 是一个请求上下文的东西, 那么可不可以把 errCh 统一在 rpc 层塞入 context.Value 呢... 这是受 flask 的模式影响了, 在 flask 里的两大上下文 request / application 用很多的应用场合. 查了一下文档, 似乎也是鼓励把 Context.Value 用在请求上下文的场合: |
|
那么问题就来了……
我理解的是这个 context 可以做到 rpc 这一层取出,但是如何通过 rpc 暴露呢
…On Tue, Nov 26, 2019 at 1:23 PM zc ***@***.***> wrote:
有一个奇异的想法, 因为 errCh 是一个请求上下文的东西, 那么可不可以把 errCh 统一在 rpc 层塞入 context.Value
呢...
这是受 flask 的模式影响了, 在 flask 里的两大上下文 request / application 用很多的应用场合.
查了一下文档, 似乎也是鼓励把 Context.Value 用在请求上下文的场合:
Use context Values only for request-scoped data that transits processes and APIs, not for passing optional parameters to functions.
https://golang.org/pkg/context/#WithValue
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#148?email_source=notifications&email_token=AAD3S2BW3DQVEQFA6E4J623QVSXE3A5CNFSM4JMSYSU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFEYD4Q#issuecomment-558465522>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD3S2CFFU6MG72DSV4PRM3QVSXE3ANCNFSM4JMSYSUQ>
.
--
-CMGS
A simple coder.
Love travel, sports especially outdoor sports and computer technology.
Have a dream that one day can tour around.
|
|
比方说 rpc 层里把 ctx 包一下再传给 calcium: calcium 要取 errCh 的时候直接 同理 store 等下层都可以取出, 只要 ctx 是一路传递下去的. |
|
为啥没下文啦 这个功能还挺有用的 @yonghaowu |
|
@jschwinger23 代码还要再改改,那时忙着搞CacheCloud了,我这几天改改 |
46cedb9 to
dfbbb24
Compare
那时到现在都过了一年了。。。 |
|
那时到现在都过了一年零8天了。。。 |
90c661a to
463834f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改下 calVolCPUMemNodeContainersInfo 就好了
|
@jschwinger23 好!等我 整体再看看,对抽出来的函数的命名感觉不太准确 |
No description provided.