Demonstrating the threaded versus non-threaded uploader

Before editing Application to use our new threaded uploader, let's see how the traditional single-threaded version behaves with the slowed-down test server. Start the server, launch your application, make sure there are some entries for the current date, then run the REST upload. Notice how the application freezes hard for at least 12 seconds before returning control.

Now, let's make the necessary adjustments to Application to use our multithreaded uploader.

Replace the call to the upload_to_corporate_rest() function with this:

 self.uploader = n.CorporateRestUploader( csvfile, self.settings['abq_upload_url'].get(), self.settings['abq_auth_url'].get(), username, password) self.uploader.start() ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.