- Notifications
You must be signed in to change notification settings - Fork1.1k
micropython/aiorepl: Use blocking reads for raw_repl.#1005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@dpgeorge I tested this with just raw paste in blocking, reverting the rest of raw repl to async. On an application with active log messages (~1 per second) |
micropython/aiorepl/aiorepl.py Outdated
| sys.stdout.write("\x08\x08") | ||
| elifc==CHAR_CTRL_A: | ||
| awaitraw_repl(s,g) | ||
| awaitraw_repl(g) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Leaves as an argument, but pass insys.stdin.
2c01807 tof5ee51eCompareUh oh!
There was an error while loading.Please reload this page.
f5ee51e tobc5bb9fCompareRaw REPL mode is generally used as a command channel where all stdiotraffic is related directly to the raw commands and responses sent.For this to work in aiorepl we need to ensure background tasks don't sent/receive anything on stdio else the command channel will be corrupted.The simplest way to achieve this is to make the raw commands blocking andatomic rather than asyncio, assuming the user wont leave the device in rawmode for too long at any one time.Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
aad2e48 intomicropython:masterUh oh!
There was an error while loading.Please reload this page.
raw repl mode is generally used as a command channel where all stdio traffic is related directly to the raw commands and responses sent.
For this to work in aiorepl we need to ensure background tasks don't sent/receive anything on stdio else the command channel will be corrupted.
The simplest way to achieve this is to make the raw commands blocking rather than asyncio, assuming the user wont leave the device in raw mode for too long at any one time.