[Qgis-developer] pyqgis: parallel QThreads to services possible?

Nyall Dawson nyall.dawson at gmail.com
Tue May 3 14:40:19 PDT 2016


On 4 May 2016 07:32, "Richard Duivenvoorde" <rdmailings at duif.net> wrote:
>
> On 03-05-16 22:56, Nyall Dawson wrote:
>
> > https://github.com/qgis/QGIS/pull/3004
> >
> > is designed to handle cases like this. I'd very much value it if you
> > could read over the comments on the PR and confirm that the PR design
> > would meet your needs (or not!)
>
> Hi Nyall,
>
> had not seen this before, nice ( movies ;-) ) and good ideas
>
> yes, I think this could absolutely work for my problem, though for
> general use we should
> - document, document, blog, blog, write, document it clearly
> - make the api so clear/clean that even I can use it

I'm targeting this to after 2.16 so there should be plenty of time to make
the design rock solid :)

>
> I think in the comments about processing it is already mentioned, but
> the 'chaining' of tasks would be possible/easy.
>
> Like in my case:
> - when task-1 (WPS) is finished start task-3
> - task-3 (merge all the shp files and do some magic with attr)
> - task-2 (WFS) is finished start task-4
> - task-4 do some magic with the gml
> - if all those are done: show the results...

That's already implemented. You can set task "dependancies", and the
manager will magically handle the rest. This includes things like auto
cancelling any remaining tasks when one of their dependancies fails (or is
cancelled).

It will basically run as many tasks as possible (given available threads),
and whenever a task finishes it looks through the list for any tasks which
were waiting on that task and fires them up ASAP.

Nyall

>
> Which off course looks a lot like processing modeller...
>
> Anyway: nice work and also a good example of discussion/communication
> between devs. Thanks all!
>
> Regards,
>
> Richard
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160504/4efa8bbb/attachment.html>


More information about the Qgis-developer mailing list