Skip to content
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

Allow for multi-threaded requests to the API. #91

Merged
merged 2 commits into from
Nov 1, 2018

Conversation

ntoll
Copy link
Contributor

@ntoll ntoll commented Oct 31, 2018

Fixes #90.

This PR introduces the capability of having multiple API calls "in flight" at the same time. Things to note:

  • The api_threads dict stores the thread, APICallRunner instance and QTimer associated with each call against a unique uuid.
  • When the status of the thread is resolved (the call completed or there was a timeout) the clean_thread method cleans up things and removes the entry in api_threads.
  • Everything else works pretty much the same.
  • When it comes to setting status messages... these should be done in the code calling the call_api method, or in the event handlers passed into handle the possible outcomes (this seems the sensible place to do it since the call_api method is "function neutral"). See the way I've done this in on_file_click and on_file_download.

Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked as excepted on my system.

@redshiftzero redshiftzero force-pushed the multi-threading-requests branch from ea28530 to 276470b Compare November 1, 2018 23:23
Copy link
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very clear implementation - thanks @ntoll! rebased to fix conflicts and approving

@redshiftzero redshiftzero merged commit a24e93a into master Nov 1, 2018
@redshiftzero redshiftzero deleted the multi-threading-requests branch November 1, 2018 23:27
legoktm pushed a commit that referenced this pull request Dec 11, 2023
…s-6.2.0

use latest pip-tools and update readme
legoktm pushed a commit that referenced this pull request Dec 15, 2023
Getting ready for 0.0.10 release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable other API actions while files are downloading
3 participants