Shinmera/lquery

Master Document Is Clobbered If Initialize Is Used from Multiple Threads

Closed this issue · 2 comments

If lquery is used in multiple threads, then *lquery-master-document* will be clobbered. A simple workaround is to wrap each thread's HTML processing in:

(let (org.shiramuko.lquery::*lquery-master-document*) ... )

Perhaps this can be mentioned in the docs and/or made nicer by supplying a with-lquery-document macro.

Lquery is really useful, thanks.

I'm a bit conflicted on this because I'd prefer removing the master document altogether more than anything. It is mostly something that stuck around due to the way things were handled in the very first version of lQuery.

I'm probably going to rewrite the examples in the docs to use an explicit binding rather than relying on the deprecated and implicit usage of the master document. I won't remove the master document from the code though as it would break too much existing stuff that relies on it being around.

Added the macro anyway because why not. Docs should now no longer rely on the fact that the master-document exists, but it's still there so you don't have to rewrite your code.

I think that's all for this.