Thymeleaf异步处理

时间:2017-03-29 08:44:08

标签: thymeleaf

我会使用百万美元3模板引擎来包含外部/远程片段。

今天我尝试遵循语法

<!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>

虽然有效,但如果每个端口的每个服务都需要2秒才能响应,模板将至少在 2 + 2 + 2 = 6秒之后生成。

我正在寻找更多异步/并行的东西,其中模板生成 MAX(2,2,2 = 2秒(+/-生成其他东西的时间)。

我没有找到任何内置的方法,但如果您对我应该从哪里开始以及如何开始有任何线索,我还没有接近延长Thymeleaf 3。

PS:我知道有DataDriven功能,但我没有看到异步的方式来注入数据,它实际上是处理模板的异步方式!

0 个答案:

没有答案