3 ms·
@semisync(callback=output) does indicate that the call is asynchronous and will be called immediately. If a dependency was specified @semisync(dependencies=[f
by madisonmay 13y ago
@semisync(callback=output) does indicate that the call is asynchronous and will be called immediately. If a dependency was specified
@semisync(dependencies=[function_name])
the function will only be called once 'function_name' has been executed. In this sense, it's not entirely synchronous, and not entirely asynchronous.
With regards to the flask question, you'd see an output after 5 seconds when the function finishes and returns. "Revenue" would only be printed after the function terminates. If you'd like, you could log something at the beginning of the function to let you know when execution begins.
- notastartup 13y agoIs it possible to somehow show the revenue page immediately upon requesting it (/revenue) and after 5 seconds, receive the output callback results and stick it into the DOM?
- madisonmay 13y agoI don't think that's it's possible to push to the client from the server without the client initiating a request, so I think that use case is better suited for a client side AJAX call.