-
Notifications
You must be signed in to change notification settings - Fork 66
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
Cancel obsolete requests #268
base: main
Are you sure you want to change the base?
Conversation
7fae009
to
e51cc5f
Compare
e51cc5f
to
c1bc989
Compare
a99e024
to
386d3ea
Compare
386d3ea
to
4e58dfb
Compare
@@ -315,6 +317,12 @@ def requestRefresh(self, rectF, stack_id=None, prefetch=False, layer_indexes=Non | |||
""" | |||
stack_id = stack_id or self._current_stack_id | |||
tile_nos = self.tiling.intersected(rectF) | |||
to_cancel = self._current_requests | |||
self._current_requests = {} |
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.
Volumina's code is kinda hard to navigate, so I'd love to see some type annotations like
self._current_requests: Mapping[Tuple[LAYER_ID, ImageSource, REQUEST_ID], ArrayRequest] = {}
else: | ||
ims_req.cancel() | ||
|
||
self._current_requests.pop((stack_id[1], ims, tile_nr), None) |
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.
Are you using pop
here because the request might have been already removed from self._current_requests
?
This kinda makes me think if it would be possible for a request to overwrite an older one; If I, say, load an image in a layer, make a request, drop that layer, then load another image and make another request, is it possible for the second request to overwrite the previous one? Even worse, is it possible for the second one to be cancelled when we meant to cancel the first?
No description provided.