mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-05 16:46:58 +08:00
feat: add stop subscribe api, show reasons for subscriber closure
This commit is contained in:
@@ -55,7 +55,8 @@ func (b *LimitBuffer) Write(a []byte) (n int, err error) {
|
||||
l := b.Len()
|
||||
newL := l + len(a)
|
||||
if c := b.Cap(); newL > c {
|
||||
panic(fmt.Sprintf("LimitBuffer Write %d > %d", newL, c))
|
||||
return 0, fmt.Errorf("LimitBuffer Write %d > %d", newL, c)
|
||||
// panic(fmt.Sprintf("LimitBuffer Write %d > %d", newL, c))
|
||||
} else {
|
||||
b.Buffer = b.Buffer.SubBuf(0, newL)
|
||||
copy(b.Buffer[l:], a)
|
||||
|
Reference in New Issue
Block a user