bluesky / ophyd

hardware abstraction in Python with an emphasis on EPICS
https://blueskyproject.io/ophyd
BSD 3-Clause "New" or "Revised" License
51 stars 79 forks source link

status: do not create thread to run callbacks if timeout is None #1182

Closed mguijarr closed 8 months ago

mguijarr commented 8 months ago

Here is a merge request that mitigates concern expressed here: https://github.com/bluesky/ophyd/pull/837#discussion_r409007458 (also linked with issue #844).

I have the impression, a simple optimization is to not create a thread if it is not needed (in particular when timeout is set to None, which seems to be most of the time).

Otherwise some background about the problem Status objects want to solve with the callbacks thread would be insightful.

tacaswell commented 8 months ago

Thank you for this, this seems sensible to me and looks correct to me.

Can you add a test in test_status.py to cover the case with no timeout but a settle time?

mguijarr commented 8 months ago

@tacaswell Done

tacaswell commented 8 months ago

Thank you @mguijarr !