I had the same issue, so I created a library to solve it.
The big advantage is that it fixes Shotgun not being thread safe, so it allows to make all needed requests in parallel.
It also adds yield_find
that yields entities one by one as they become available instead of returning them once all the fields have been computed/retrieved.
Hey, since I created a library to deal with the first issue, I thought I might as well tackle your issue.
I added a method yield_page_entities
to my library that does just that.
Hope it’s useful!
This is amazing work, thank you. It opens up a lot of opportunities to have dynamically configurable filters that Artist / Prod can control to drive existing automated processes.
It’s still not perfect, it could be hugely optimized by simplifying queries. Right now, each query field has one filter that makes it match the entity it’s on. It would be way more efficient to aggregate all of these single queries (one per entity) into one query for all entities and then assign the right result to the right entity. But I haven’t had the time to look into it yet. Since it’s open source, I’m hoping someone will tackle it at some point TBH