scanse / sweep-sdk

Sweep SDK
MIT License
90 stars 85 forks source link

Non-blocking reads #109

Closed MikeGitb closed 6 years ago

MikeGitb commented 7 years ago

I think it would be helpful, if there was a possibility to check if new scans are available without having to block if there aren't.

I can think of 3 ways how this could be accomplished

dcyoung commented 7 years ago

I'm not partial towards the format, but adding an is_scan_ready would mirror the style of get_motor_ready(). Unless we want to restructure existing parts of the API, it might be nice to keep things consistent.

I think we should add timeouts to any function that blocks, including the constructor. We can choose sensible defaults so most users can avoid specifying a timeout. But it would be nice to have an optional parameter for those that want to specify the timeout duration. However, most blocking methods have a minimum blocking time... and it would be silly to allow a user to specify a timeout duration shorter than the minimum possible method duration. Not sure what the best way to enforce this is.

I'll have to double check, but I believe certain serial operations are capable of hanging in the case of an error. We should make sure all serial operations can timeout.

MikeGitb commented 6 years ago

If I understand correctly, this project is being shut down so I'm closing this issue.