Custom event handling in Vaadin

Hello,

I’m writing an application that has some sort of scanner. That scanner works on server side. The User should be able to start the scanning process on client side. This is already done & works fine. My problem now is following: The scan can take a long time. Therefor I need to give the user control to abort the scanning process. Also, the scanning process should inform the user for every new found device.

For this behavior I need some sort of custom event handling with 3 events:

1.Found new device

2.Scan finished

3.Abort scan

Is there a way to do this in Vaadin? I found “Using Events with Components” in DOCs (https://vaadin.com/docs/v14/flow/creating-components/tutorial-component-events.html) but this did not work. I could fire the Event in server side, but the listener on client side never received the event. Is there a working example on GitHub or an other alternative for a custom event handling?

If you want to “push” events from the server to the client, you can enable @Push and use it:
https://vaadin.com/docs/v14/flow/advanced/tutorial-push-access.html