Improve command reader
This commit is contained in:
parent
f6b2c442ae
commit
900da36a1f
1 changed files with 6 additions and 2 deletions
|
|
@ -91,7 +91,9 @@ class CommandReader extends Thread{
|
|||
if($this->readline){
|
||||
readline_callback_handler_install("Genisys> ", [$this, "readline_callback"]);
|
||||
$this->logger->setConsoleCallback("readline_redisplay");
|
||||
}
|
||||
}else{
|
||||
stream_set_blocking($this->stdin, false);
|
||||
}
|
||||
|
||||
while(!$this->shutdown){
|
||||
$r = [$this->stdin];
|
||||
|
|
@ -112,7 +114,9 @@ class CommandReader extends Thread{
|
|||
if($this->readline){
|
||||
$this->logger->setConsoleCallback(null);
|
||||
readline_callback_handler_remove();
|
||||
}
|
||||
}else{
|
||||
stream_set_blocking($this->stdin, true);
|
||||
}
|
||||
}
|
||||
|
||||
public function getThreadName(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue