Skip to content

Commit

Permalink
opt: prioritize writable events
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Feb 3, 2021
1 parent 2404edd commit 0f08c8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion loop_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (el *eventloop) handleEvent(fd int, ev uint32) error {
return err
}
}
if ev&netpoll.InEvents != 0 {
if ev&netpoll.InEvents != 0 && c.outboundBuffer.IsEmpty() {
return el.loopRead(c)
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion reactor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (svr *server) activateSubReactor(el *eventloop, lockOSThread bool) {
return err
}
}
if ev&netpoll.InEvents != 0 {
if ev&netpoll.InEvents != 0 && c.outboundBuffer.IsEmpty() {
return el.loopRead(c)
}
}
Expand Down

0 comments on commit 0f08c8f

Please sign in to comment.