Conversation
subt/main.py
Outdated
| pass | ||
|
|
||
|
|
||
| class TimeoutMonitor: |
There was a problem hiding this comment.
I would vote for separate file (main.py is too big already) ... and maybe it is generic enough that we want it in osgar.lib? Or monitors??
subt/main.py
Outdated
|
|
||
| def __exit__(self, exc_type, exc_val, exc_tb): | ||
| self.robot.unregister(self.handle) | ||
| if exc_val is not None: |
There was a problem hiding this comment.
I would check that the type matches to TimeoutEx
ec3f108 to
9385c25
Compare
|
My plan with this PR is to add usage of the TimeoutMonitor. I'd like to test it in Virtual world, but for that I need to do some fixes first. So I would mark this "on hold" until then. |
9385c25 to
476bbc6
Compare
|
I see that we already had monitors implemented! I also see implementation of your comment where you catch exceptions in the exit |
|
Well... yet, but you didn't want to merge it until it is used as well. I didn't get to use it since I was hunting the bigger problems in virtual. So it is waiting here until I get to it again. |
|
I needed monitors for external "locomotive" project, where I use osgar pypi installation - maybe it would be nice if this would be directly part of osgar and not SubT? Also Moon needed monitors ...maybe part of larger refactoring, including |
Implement part of #369 by providing
TimeoutMonitorclass. Example usage is intest_subt.py. Having this context manager allows adding timeout to any function that periodicaly callsupdate()inside.