This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
WIP: Usubscribe from events on the next subscription (PyTango#292) #1095
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similarly to #1091 and #1093, this PR tries to workaround tango-controls/pytango#292.
I tried this PR with sardana-org/sardana#1312 ( which reverts the Sardana workaround and use zombie concept in tests) and it works corrrectly for the sardanatestsuite and for the stress macro posted in #1093 (comment). So, IMO it is a satisfactory workaround.
Note that it has one side effect - it keeps garbage collected attributes subscribed until some new attribute is subscribed. To mitigate this effect attributes are marked as zombies - their push event return immediately. Also this should happen only for the configuration events - the change events should be unsubscribed with the last
TaurusModel.removeListener
call. Also if one wants to increase the frequency of unsubscribes thetangoattribute._empty_unsub_queue()
could be called more frequently.