knuxify / fxtumblr

Make Tumblr embeds on other websites way better. Like TwitFix/fxtwitter, but for Tumblr.
https://tpmblr.com
MIT License
16 stars 2 forks source link

Add render queue #15

Closed knuxify closed 10 months ago

knuxify commented 1 year ago

Currently, if the same post is requested multiple times at once, and needs to be rendered, every request will try to do the render at the same time. This can cause slowdowns at best and race conditions at worst.

As such, there should be a queue shared across all instances (hypercorn seems to spawn multiple from what I've seen) that keeps a list of ongoing renders and prevents this from happening. (Note that this doesn't mean renders can only work on one thread - in fact, they should be multithreaded, though perhaps the queue is also a good occasion to limit the amount of possible concurrent renders).

knuxify commented 10 months ago

7ae374743d4fb45869232782c1ab93d8ae2a6b9d adds a queue but doesn't deduplicate yet