Processing Asynchronous Thimeleafers

I would use the thymeleaf 3 template engine to include an external / remote fragment.

Today I am trying to use the following syntax

<!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Thymeleaf test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <div th:insert="http://localhost:5001/"></div> <div th:insert="http://localhost:5002/"></div> <div th:insert="http://localhost:5003/"></div> </body> </html> 

This works, but if each service on each port takes 2 seconds to respond, a pattern will be generated at least after 2 + 2 + 2 = 6 seconds .

While I was looking for something more async / parallel, where the template generation would be MAX (2, 2, 2) = 2 s (+/- time to create other things).

I did not find a built-in method, but I am not close to the Thymeleaf 3 extension if you have a clue on where to start and how.


PS: I know that there is a DataDriven function, but I'm not looking for a way to asynchronously enter data, this is a really asynchronous way to process the template!

+5
source share

Source: https://habr.com/ru/post/1266066/


All Articles