-
Notifications
You must be signed in to change notification settings - Fork 837
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
refactor: stream api #1658
base: develop
Are you sure you want to change the base?
refactor: stream api #1658
Conversation
client/client.go
Outdated
sxStreamMW streamx.StreamMiddleware | ||
sxStreamRecvMW streamx.StreamRecvMiddleware | ||
sxStreamSendMW streamx.StreamSendMiddleware | ||
eps cep.UnaryEndpoint |
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.
这个怎么和原来的 endpoint.Endpoint 兼容
internal/client/option.go
Outdated
|
||
type StreamOptions struct { | ||
EventHandler stream.StreamEventHandler | ||
RecvTimeout time.Duration |
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.
Recv/Send 都暴露了 ctx 参数,到底是使用 ctx 里的 deadline 还是这里的配置得斟酌下
client/client.go
Outdated
kc.eps = mwchain(innerHandlerEp) | ||
eps := mwchain(innerHandlerEp) | ||
|
||
kc.eps = cep.UnaryChain(kc.opt.UnaryOptions.UnaryMiddlewares...)(func(ctx context.Context, req, resp interface{}) (err error) { |
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.
对于 Ping-Pong 调用,我们期望的是WithMiddleware
被WithUnaryMiddleware
取代?
那么中间件的执行顺序也应该保持一致吧,我理解按照这里的拼装方式,UnaryMiddleware 先执行了
916a7a6
to
0693120
Compare
4b98864
to
91effeb
Compare
91effeb
to
326f232
Compare
7c0df80
to
58976c6
Compare
What type of PR is this?
refactor
Check the PR title.
(Optional) Translate the PR title into Chinese.
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional):
(Optional) Which issue(s) this PR fixes:
(optional) The PR that updates user documentation: