Open scriptbae opened 7 years ago
Interesting, I usually use this when I intend the request to be for an Ajax call but the intended use is to return a "future". I'd need to investigate how this changes the Javascript implementation. But you are right, these functions are definitely synchronous.
This shouldn't require any changes in the JavaScript implementation. XHRs are already asynchronous by default -- so the JS runtime will happily dispatch it, continue running the EL, and then run onreadystatechange
whenever necessary.
Rest assured that student.js
was built with this in mind, although an extra pair of eyes on it is always welcome.
The
@asynchronous
decorator is meant for handler methods which should, e.g., perform actions while a database query is carried out.At a glance, no methods in
backend.py
actually benefit from the use of@aynchronous
, and block pending database output (which is generally returned fast enough that it makes very little difference whether or not@asynchronous
is used).This isn't a high-priority issue, but should be considered as time is made available for code cleanup and reorganization.