Hi
I am trying to update my grid whenever a new alert is inserted into my database. I have verified that the dataprovider infact has updated with a dataProvider.refreshAll() on a button click.
I’m now struggeling with trying to update this with a ChangeStream event, but the UI is halting for some reason. Here is my code:
alertService.onChange()
.subscribe(changeEvent -> {
System.out.println(changeEvent);
getUI().ifPresent(ui -> {
ui.access(() -> {
dataProvider.refreshAll();
});
});
});
If I only have the printout the changeEvent is indeed the changed document, I also have verified that the UI is accesed but the refreshAll() is completely blocking the whole ui thread after one fire of the change event and I have to restart app.
Any suggestions would be appriciated!