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:
1 parent
7676c17f27
commit
49d84f7cfc
1 file changed
+2
-2
+2
-2
@@ -319,8 +319,8 @@ class CLI( Cmd ):
|
|||||||
nodePoller = poll()
|
nodePoller = poll()
|
||||||
nodePoller.register( node.stdout )
|
nodePoller.register( node.stdout )
|
||||||
bothPoller = poll()
|
bothPoller = poll()
|
||||||
bothPoller.register( self.stdin )
|
bothPoller.register( self.stdin, POLLIN )
|
||||||
bothPoller.register( node.stdout )
|
bothPoller.register( node.stdout, POLLIN )
|
||||||
if self.isatty():
|
if self.isatty():
|
||||||
# Buffer by character, so that interactive
|
# Buffer by character, so that interactive
|
||||||
# commands sort of work
|
# commands sort of work
|
||||||
|
|||||||
Reference in new issue
Block a user