You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the communicate() function which is used to run query.py has the problem that it waits for all results to be finished before returning. A query for something rare then becomes slow, even though first results may be available within seconds. It is a simple thing to use pipes and get the output as query.py produces it (we just need to add flush() calls into query). But will the browser show the results as they keep coming? I.e. is the browser rendering the page while it is receiving it, or does it wait for the load to finish before it starts doing something?
The text was updated successfully, but these errors were encountered:
In general, modern browsers will start rendering incomplete pages after a bit of delay. There's something of a black art of making pages work well with this feature, but it should not be impossible to take advantage of it.
At the moment, the function query_and_fill_template() waits for all results and then formats them for return, so chaging the communicate() bit wouldn't help. What needs to be done is to rewrite the whole query response bit to yield the start of the document immediately (the framework will send over anything that rendering functions yield to it), and then yield the results as they come in over the pipe.
This will require giving up the current template approach and instead split the HTML into pieces that can be sent over independently (mainly head, tail, and anything that wraps individual results).
I should be able to look into this next week, ping me if you don't hear back.
the communicate() function which is used to run query.py has the problem that it waits for all results to be finished before returning. A query for something rare then becomes slow, even though first results may be available within seconds. It is a simple thing to use pipes and get the output as query.py produces it (we just need to add flush() calls into query). But will the browser show the results as they keep coming? I.e. is the browser rendering the page while it is receiving it, or does it wait for the load to finish before it starts doing something?
The text was updated successfully, but these errors were encountered: