Problem with asynchronous update, using Vaadin 11

Hi, I’m trying to update my user interface when my photo resistor registers an interruption. The interruption is registered, but not displayed, until the next server request is used.

The light barrier is directly connected to a RaspberryPi (model 3b+) on which the WildFly server (version 14.0.1) is running.

Unfortunately the Vaadin documentation didn’t help.

Edit:
The error message is “Push is not enabled”, but I’m using Chrome on the RaspberryPi, so it can’t be due to HTTP/2 support.

Forgive the silly question, but did you already had a look at PUSH configuration section on Vaadin docs?

https://vaadin.com/docs/v11/flow/advanced/tutorial-push-configuration.html

HTH
Marco

Thanks for the reply,
I already looked at the Vaadin docs and the example “PushyView” works perfectly fine.

But when I try to implement it in my Code, it doesn’t work.
This is my Thread, which should update a Label on the Game UI, everytime when the photo resistor is interrupted.
The goals are updated correct, but not the Label.

private static class TorInputListenerThread extends Thread {
	private final UI ui;
	private final Game view;

	private int count = 0;

	public TorInputListenerThread(UI ui, Game view) {
		this.ui = ui;
		this.view = view;
	}

	@Override
	public void run() {
	// Update the data for a while
	tor1Input.addListener(new GpioPinListenerDigital() {

		@Override
        public void handleGpioPinDigitalStateChangeEvent(GpioPinDigitalStateChangeEvent event) {
			if (event.getState() == PinState.LOW) {
				System.out.println("Tor for " + view.team1.getTeamName());

				ui.access(() -> {
					view.lblGoalTeamOne.setText(
							"Goals " + view.team1.getTeamName() + ": " + view.team1.scoredGoal());

					// Wenn ein Team gewonnen hat
					if (view.team1.getGoals() >= 10) {
						view.shutdown();
					}
				});
			}
		});
	}
}

View update through UI.access seems ok to me.
Are you able to share a more complete example?

Okay, I know now what the mistake is.
I didn’t call the class via a route, instead I created an object from the class. The UI update works great with the route.

But now I have the problem that I have to pass parameters (two Booleans and two other classes) to the class. But with routes I can only pass strings, right?

If i remember well supported data types are String, Integre, Long and Boolean.
If you need something else maybe you can use Wildcard parameter and manually deserialize string as you need

HTH
Marco