mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-25 03:22:58 +03:00
optimized flow control
This commit is contained in:
parent
52dd0db5f6
commit
5087e7de25
@ -39,13 +39,14 @@ class FlowControl {
|
||||
this.bytesWritten += data.length
|
||||
if (this.bytesWritten > this.bytesThreshold) {
|
||||
this.pendingCallbacks++
|
||||
if (this.pendingCallbacks > this.highWatermark) {
|
||||
this.bytesWritten = 0
|
||||
if (!this.blocked && this.pendingCallbacks > this.highWatermark) {
|
||||
this.blocked = true
|
||||
this.blocked$.next(true)
|
||||
}
|
||||
this.xterm.write(data, () => {
|
||||
this.pendingCallbacks--
|
||||
if (this.pendingCallbacks < this.lowWatermark) {
|
||||
if (this.blocked && this.pendingCallbacks < this.lowWatermark) {
|
||||
this.blocked = false
|
||||
this.blocked$.next(false)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user