software used:
- IDE: IntelliJ IDEA
- Postman Platforme to perform requests
- Jython standalone API as a python interpreter
- Download Jython standalone .jar file from here and add it to your IDE libraries.
Task1: used spring web dependency to setup my spring boot environment
Task2: used Jython interpreter to execute the parsed JSON entry and an outputStream to capture the result
Challenge1: just made sure only one instance of the python interpreter is handling all the subsequente requests
Challenge2: created a hashmap that stores an instance of the python interpreter and a sessionID, so that each request either creates a new python interpreter instance ( if the sessionID is new ) or call an existing one.