-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add bufferchain for HTTP2 stream #23
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23 +/- ##
==========================================
+ Coverage 63.00% 63.65% +0.65%
==========================================
Files 17 18 +1
Lines 819 908 +89
==========================================
+ Hits 516 578 +62
- Misses 248 276 +28
+ Partials 55 54 -1
Continue to review full report at Codecov.
|
please fix the golang-ci lint warnings~ 这个 PR 的背景和上下文是啥? |
|
看了下是引入testify 导致的,pkg这个库 希望尽可能少的依赖,避免别的库引用的时候依赖过多,建议修改掉 |
这个月不处理完,这个PR就关闭了哈 |
这个PR 是为 http2 流式请求建立一个 bufferchain,downstream的buffer在这个队列中直接送到upstream消费 |
这个pr能过,再更新修改mosnhttp2流式的哪个pr |
我看把vendor代码改了,但是go.sum没有改,应该不是正常的改动方式 |
请按照标准流程来处理go.mod相关的文件 |
go.sum 已回退 |
} | ||
|
||
// NewIoBufferChain returns *bufferChain. | ||
func NewIoBufferChain(capacity int) *ioBufferchain { |
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.
return IoBuffer
// chain is full conn goutine wait 1s to consumer | ||
ticker := time.NewTicker(1 * time.Second) | ||
select { | ||
case <-bc.errChan: |
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.
ticker.Stop()
return len(bytes), nil | ||
default: | ||
// chain is full conn goutine wait 1s to consumer | ||
ticker := time.NewTicker(1 * time.Second) |
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.
should be time.NewTimer() ?
case <-bc.errChan: | ||
return | ||
default: | ||
close(bc.errChan) |
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.
we need pass error code, such as ErrWriteCovered
* ioBufferchain | ||
* For HTTP2 stream, in order not to break the structure-adaptation interface. | ||
*/ | ||
type ioBufferchain struct { |
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.
Disable PutIoBuffer()
Line 69 in f639c3a
if p, _ := buf.(*pipe); p != nil { |
// ErrWriteCovered bufferchain queue is full. | ||
var ErrWriteCovered = errors.New("chain write covered") | ||
|
||
const defaultCapacity = 1 << 9 |
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.
too big ...
Bufferchain is added for http2 stream and Iobuffer is implemented