Directory

← Back

Veaktor

Use Project Reactor and Vaadin together

Author

Rating

Popularity

<100

Veactor is a set of helpers to use Project Reactor and Vaadin together.

The main functionality is focused on updating parts of a Vaadin UI when new elements are published to a Flux or Mono. This is done using an appropriate subscribe method in the Veactor class. Each of those methods requires a component instance that is used to control the life cycle of the subscription - the subscription is started when the component is attached (happens immediately if it's already attached when subscribe is called) and the subscription is closed when the component is detached again.

@Push
@Route("hello")
public class HelloWorldView extends VerticalLayout {
  public HelloWorldView() {
    Flux<Long> flux = Flux.interval(Duration.ofSeconds(1)).take(10);

    Span message = new Span("Waiting for updates...");

    Veactor.subscribe(this, flux, value -> message.setText("Received value " + value));

    add(message);
  }
}

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Initial working version

Released
2021-07-30
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 10+
Browser
Browser Independent

Veaktor - Vaadin Add-on Directory

Use Project Reactor and Vaadin together Veaktor - Vaadin Add-on Directory
Veactor is a set of helpers to use Project Reactor and Vaadin together. The main functionality is focused on updating parts of a Vaadin UI when new elements are published to a `Flux` or `Mono`. This is done using an appropriate `subscribe` method in the `Veactor` class. Each of those methods requires a component instance that is used to control the life cycle of the subscription - the subscription is started when the component is attached (happens immediately if it's already attached when `subscribe` is called) and the subscription is closed when the component is detached again. ```java @Push @Route("hello") public class HelloWorldView extends VerticalLayout { public HelloWorldView() { Flux flux = Flux.interval(Duration.ofSeconds(1)).take(10); Span message = new Span("Waiting for updates..."); Veactor.subscribe(this, flux, value -> message.setText("Received value " + value)); add(message); } } ```
Online