-
Notifications
You must be signed in to change notification settings - Fork 7
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add idle time support #194
Conversation
isIdle() | ||
]).then((result) { | ||
final currWindow = (result[0] as ProcessResult).stdout; | ||
final idleState = result[1]; |
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.
what happens if the process crashes? Can result[1] ever cause an out of bounds access problem?
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.
If the process crashes, ProcessResult will still be generated with an non-zero exit code, the stdout will probably be empty or garbage but those were handled. If one of the Process.run
throws an exception then the then
body will not be executed and the error will be caught by the catchError
below.
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.
Thanks
isIdle() | ||
]).then((result) { | ||
final currWindow = (result[0] as ProcessResult).stdout.trim(); | ||
final idleState = result[1]; |
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.
is it possible to get an out of bounds error here?
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.
Same as above
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.
Thanks
Thanks! Looks great! Just a few small questions. |
Fixes #179
Fixes #180