com.vaadin.hilla.
Class EndpointSubscription<TT>
A subscription that wraps a Flux and allows to listen for unsubscribe events from the browser.
An unsubscribe event is sent when "cancel" is called in the browser but also if the browser has disconnected from the server either explicitly or been disconnected from the server for a long enough time.
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<TT>
getFlux()
Returns the flux value provide for this subscription.
Returns the callback that is invoked when the browser unsubscribes from the subscription.
static <T> EndpointSubscription<T>
Creates a new endpoint subscription.
-
Method Details
-
getFlux
Returns the flux value provide for this subscription.
-
getOnUnsubscribe
Returns the callback that is invoked when the browser unsubscribes from the subscription.
-
of
public static <T> EndpointSubscription<T> of(reactor.core.publisher.Flux<T> flux, Runnable onDisconnect) Creates a new endpoint subscription. A subscription wraps a flux that provides the values for the subscriber (browser) and a callback that is invoked when the browser unsubscribes from the subscription.
Type Parameters:
T
- the type of data in the subscriptionParameters:
flux
- the flux that produces the dataonDisconnect
- a callback that is invoked when the browser unsubscribesReturns:
a subscription
-