rvesse / airline

Java annotation-based framework for parsing Git like command line structures with deep extensibility
https://rvesse.github.io/airline/
Apache License 2.0
128 stars 20 forks source link

Find a way to make Prompts not block on timeout #126

Open rvesse opened 2 years ago

rvesse commented 2 years ago

Originally noted in reviewing #125

When timeouts are used for prompts the read from the prompt provider happens on a background thread and is a blocking read. If the timeout is hit the thread doing that read is cancelled but may still be stuck in that blocking read and never actually terminate.

This means if there are subsequent prompts they may not read anything because they are queued up behind the blocked read. This necessitates users having to hit the return key extra times, or enter their response multiple times.

Might be useful to make this interruptible, or otherwise track unfinished reads and prevent subsequent prompts on the provider.