View Single Post
Old 06-01-2018, 12:21 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,909
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your choices are:

1) Simply run your entire job in a thread hat produces its output in a temporary directory. Show a blocking progressdialog while this is happening. After the worker thread is complete, copy the output data into calibre on the main thread.

2) Use the calibre jobs infrastructure to do all the heavy lifting for you. This is how calibre itself runs conversion/bulk metadata download etc jobs. The idea is the same, you run the job to output to a temporary dir, when it is complete you bring the data into calibre. I'm sure there must besome existing plugins that use the jobs infrastructure you can copy from.
kovidgoyal is offline   Reply With Quote