Eventbus norification from another thread

Hi,

I have a question about the refresh of the page, i have to update a label when new alarm arrives.
The new alarm is generated
by another application
, when we receive the information by web service, the Eventbus will notify the AlarmPresenter,

Then in AlarmPresenter:

@Subscribe
    public void alarmsUpdated(final AlarmUpdatedEvent event)
{
            Map<Long, Alarm> alarmslist = new HashMap<Long, Alarm>();
            for(final Map.Entry<Long, Alarm> s :        MSingleton.getInstance().getAlarms().entrySet())
            {
                alarmslist.put(s.getKey(), s.getValue());
            }
           //Update the table
            view.getContainer().removeAllItems();
            alarmslist.values().forEach(n -> view.getContainer().addBean(n));
          [b]
 Eventbus().post(new AlarmsNumberUpdatedEvent(totalSize);
[/b]
           LOGGER.info("After notification");
}

Then in menuPage:

@Subscribe
    public void alarmsUpdated(final AlarmsNumberUpdatedEvent event)
    {
       LOGGER.info("Enter");
        alarmsCount.setValue(event.total);
        alarmsCount.setVisible(true);
    }

The result is: The alarms table is updated, but the alarms number label does not change.
I can not see the message “Enter” and “After notification”. It seems that the eventbus thread is blocked juste after the notification from the AlarmPresenter.

Thank you for your help.

see section 11.16.3. “Accessing UI from Another Thread” in “Book of Vaadin”
https://vaadin.com/book/-/page/advanced.push.html

Thank you for your reply.
I have already tested with this example:

//             MainUI.getCurrent().access(new Runnable() {
//                @Override
//                public void run() {
//                  
//                   MainUI.getCurrent().getEventbus().post(new AlarmsNumberUpdatedEvent(totalSize);
//                }
//            });

But it doesn’ work, nothing changed.

I have tested with AsynchroEventBus, it works, but there are a lot of errors about “ConcurrentModificationException”…
So i think it’s better to continue use the SynchroEventBus.