You cannot use multiprocessing. On unix multiprocessing does a fork() without exec() which is totally broken for something as complex as calibre. multiprocessing is really a bit of a joke of a module.
And on windows launching a separate worker process that has to load python, then load the db would take *seconds* on a typical low powered notebook.
You need to step back from the abstract async vs. sync philosophical debate and think about actual concrete implementation.
A sync implementation updates the database in under 0.1 seconds, which is imperceptible to the user, even though the event loop might be in fact be blocked for that 0.1 second. An async implementation will result in the value *the user sees* not changing for more than 0.1 seconds, and for ~ 1 second on slower computers which is absolutely unacceptable.
|