Allow for multi-threaded requests to the API. #91
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.
Fixes #90.
This PR introduces the capability of having multiple API calls "in flight" at the same time. Things to note:
api_threads
dict stores the thread, APICallRunner instance and QTimer associated with each call against a unique uuid.clean_thread
method cleans up things and removes the entry inapi_threads
.call_api
method, or in the event handlers passed into handle the possible outcomes (this seems the sensible place to do it since thecall_api
method is "function neutral"). See the way I've done this inon_file_click
andon_file_download
.