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:
Bob Lantz
2012-05-10 17:35:34 -07:00
parent 7676c17f27
commit 49d84f7cfc
+2 -2
View File
@@ -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