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

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Sat Jan 19 17:06:27 CET 2013


> Blocking at the end, is ok... Blocking while the application is running is not.  Yes, I want my cake and to eat is as well :)
>
> I essentially want to kick off the request at the beginning of the run, then let the request run its course in the backround.
>
> If the main application (no event loop at all, non-event driven, nonQt for the most part), finishes first (rare occasion) I can block on the background thread ending.  However most times, the single http request will have finished long before

You can enqueue your requests to this thread, do all n/w processing
there and exit the thread when its done with all the requests.

Meanwhile in the main thread you can wait for this helper thread to
finish (QThread::wait()). If its not running, thne u exit away
immediately, else wait till that thread exits and then quit your main
app. Will that work?

HTH,
-mandeep

>
> Scott
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list