Is it possible to update PolymerTemplate models from a separate thread and have its bound property properly update in the client?
Server:
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
int x = 0;
@Override
public void run() {
m_myUI.access(() -> {
getModel().setGreeting(String.valueOf(x));
x++;
System.out.println(x);
});
}
}, 0, 1000);
Client:
static get template() {
return html `<h1>[[greeting]
]</h1>`;
}
What’s the proper way to do this? I get the first value that the timer sets and that’s it.