Fix poller to only check if stdin and node are readable.
Fixes busy waiting and excessive CPU usage in CLI. Thanks to James Zeng for pointing this out!
This commit is contained in:
+2
-2
@@ -319,8 +319,8 @@ class CLI( Cmd ):
|
||||
nodePoller = poll()
|
||||
nodePoller.register( node.stdout )
|
||||
bothPoller = poll()
|
||||
bothPoller.register( self.stdin )
|
||||
bothPoller.register( node.stdout )
|
||||
bothPoller.register( self.stdin, POLLIN )
|
||||
bothPoller.register( node.stdout, POLLIN )
|
||||
if self.isatty():
|
||||
# Buffer by character, so that interactive
|
||||
# commands sort of work
|
||||
|
||||
Reference in New Issue
Block a user