[Interest] QNetworkAccessManager in a command line, non-eventloop application

Scott Aron Bloom scott.bloom at onshorecs.com
Fri Jan 18 18:05:53 CET 2013


> -----Original Message-----
> From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org 
> [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On 
> Behalf Of Thiago Macieira
> Sent: Thursday, January 17, 2013 5:27 PM
> To: interest at qt-project.org
> Subject: Re: [Interest] QNetworkAccessManager in a command line, 
> non-eventloop application
>
> On sexta-feira, 18 de janeiro de 2013 00.59.13, Scott Aron Bloom wrote:
>> I have a command line application, with no event loop.
>
> We can stop here. QNetworkAccessManager requires an event loop.
>
> But if you're going to block anyway in order to do work, you can use QEventLoop to start the event loop until the request finishes.
> ----------
>
> I don't want to block :)
>
> I would like a background thread and have the request run in there, using the QThreads event loop.

But you still are waiting for this thread to finish work and then quit the app, correct?

Just curious here, but why don't you want to run the event loop in the main thread but only run it in a different thread?

-mandeep
--------------
99% (ok made up number) of the runs, take minutes (some 10s of hours, some 1-2 seconds), the 1-2 seconds in the thread will be done way way before the application is finished.

In the SMALL number of cases, its ok to block the exit of the application.

The HTTP request is made at the startup of the application

Scott




More information about the Interest mailing list