“Excuse me, can I talk to your manager?”
The SessionManager Class handles the JWT session tokens with Redis. That logic works perfectly for my needs, however… The current SQLModel logic uses FastAPI’s Dependency and each query is built for each function, despite the same one being used multiple times.
The EngineManager Class
This class mimics SessionManager, which includes the config loading via start alongside various helper functions to help with the DRY problem and sql commits.
Easing development
The send-message and read-inbox routes are now far simpler and less cluttered. Due to engine_manager.
Architecture
I had decided to stick with Manager architecture in which every section of logic and code will be under their appropriate class. For example
- SessionManager handles only and all logic related to retrieving, generating and validing session tokens.
- EnginerManager handles only and all logic related to updating and retrieving the SQL records
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.