Closed cherepanovic closed 3 years ago
It's pretty simple, I used three ingredients
Promise
The while communication works as follows:
Promise
for retrieving the embedding and queries the backend (GET request)
- If the frontend gets a response saying the backend is still running it waits a bit and sends another request
but if the user reloads the site then the site would be in the initial state and consequentially forget all previous requests (promises) to the backend etc.... or sends it (FE) always the same request to the backend independent whether something was requested to calculate?
but if the user reloads the site then the site would be in the initial state and consequentially forget all previous requests (promises) to the backend etc.... or sends it (FE) always the same request to the backend independent whether something was requested to calculate?
No. The system is smarter than that ;) On init it check what resources are already available and then just retrieves them. If they are still computing you end up again in step 5.
will look at it deeper :) thank you!
*btw is it a known best practice, does this pattern have a name?
Hello Fritz,
may I ask you how did you implement the communication between FE and BE after having triggered time-consuming operations such as model training (which run in separated threads)? How does the BE inform FE (for rerendering entire information on the page) after finishing a time-consuming job?
At the first glance, I could see that you don't use sockets.
thanks!