Tornado's web.asynchronous attribute was deprecated in Tornado v5.x and removed in x6.x, making a refactor to the server.py code necessary. server.py now uses asynchronous and code that uses native coroutines (e.g. async def, await). Some RequestHandlers were also made synchronous since they just do simple fetches of data.
The unblock function was completely removed, this seems to have been from a code snippet that is now over 9 years old, and this Tornado code in general originates from the initial commit for this repo.
Testing:
Not the most comprehensive testing, but enough to check that nothing seems to break
Tested that restful_tango/server.py runs on Python 3.7, 3.8, 3.9, and 3.10
On Python 3.10:
Tested that autograding works, autograding results get returned
Tested that partial output works, queue information shows up
Tested that getjob displays correct information for job
Tornado's
web.asynchronous
attribute was deprecated in Tornado v5.x and removed in x6.x, making a refactor to theserver.py
code necessary.server.py
now uses asynchronous and code that uses native coroutines (e.g.async def
,await
). Some RequestHandlers were also made synchronous since they just do simple fetches of data.I made the refactor mainly by going through the most recent Tornado user guide as well as reading through some example code.
Testing: Not the most comprehensive testing, but enough to check that nothing seems to break
restful_tango/server.py
runs on Python 3.7, 3.8, 3.9, and 3.10getjob
displays correct information for jobjobs
displays correct infojobs/tango_status
works