Replies: 3 comments
-
This might be more complicated than it sounds – in attrs we had to use thread locals for recursive reprs. 🤔 |
Beta Was this translation helpful? Give feedback.
-
yes I see, concurrency makes this tricky, Also async factories complicate things. Nothing a contextvar can't fix, but I guess you'd want a contextvar per container. If you want I could whip up a PR to discuss things. Although the effort/added complexity might outweigh the benefit for now :) |
Beta Was this translation helpful? Give feedback.
-
to be clear: I've skipped a step here. In svcs's case there's no hidden DAG, so get() would have to keep track of what it already got. So it could be global variable, where concurrency comes into play. But as you say, this is complexity and this also would have an impact on performance. Given the SOP, it should only happen if you misconfigure something and you should be able to find the culprit quite quick. but I'm happy to leave it open and wait what others have to say |
Beta Was this translation helpful? Give feedback.
-
Currently, cyclic dependencies raise a recursion error. It might be nice to obtain a more user friendly error message
Beta Was this translation helpful? Give feedback.
All reactions