4 ms·
To the OP, I’m just curious what was the problem you were facing that inspired this project? I haven’t run into a scenario where I would use something like thi
by zffr 6y ago
To the OP, I’m just curious what was the problem you were facing that inspired this project?
I haven’t run into a scenario where I would use something like this before
- nyellin 6y agoSure. The short version is that this is for cases when you write frontend and backend code in different languages and they need to share constants. E.g. you might have an API in your backend called ExportData() which takes a parameter called ExportType that can be JSON_OUTPUT, TEXT_OUTPUT, CSV_OUTPUT, etc and you want to re-use those constants between the frontend and backend because they are often transmitted between the two. The long version is that I developed an application that runs on Kubernetes and can profile any Python application running in your cluster with no prior setup. (Useful if you want to debug a performance issue in an already running application.) My application has a Javascript frontend written in Vue.js and a Python backend written using the FastAPI framework. A user clicks a button in the frontend and chooses which process they want to profile and what type of profile it should be. (E.g. a regular flamegraph profile, a text file containing all the stack dumps, etc.) Then Vue initiates an API call to the backend. The backend checks what type of profile was requested and performs it for the client. I wanted to share the ProfileType enum between the frontend and backend. At first I just duplicated the constants by hand in Javascript and Python but I kept changing them as I added new features and got tired of syncing them by hand. Hope this helps explain the use.