Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not really a singleton if it returns an instance per session instead of a global one.


Yeah, its not really at true singleton in the dangerous sense in the context of a webserver, when you have a separate copy of the environment for each HTTP connection. It wouldn't be a singleton unless the same state could be accessed by different HTTP sessions.

I haven't come across a web framework that enables this, as you might expect; there's no good reason to do so.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: