-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Description
Please implement non-blocking console input, e.g. ConsoleReader.readCharacterNoWait(). It would only require a minor change in NonBlockingInputStream and ConsoleReader.
I'm writing a console-mode communications tool, where I have to read from the console without blocking. I know that I could use a separate thread to do that.
I tried the following code:
ConsoleReader con = new ConsoleReader();
NonBlockingInputStream in = (NonBlockingInputStream)(con.getInput());
int key = in.read(1);
But: 1. i'ts not guaranteed that future versions of ConsoleReader.getInput() will return a NonBlockingInputStream and 2. it blocks 1ms if no keyboard input is ready.
aziubin
Metadata
Metadata
Assignees
Labels
No labels