Class SubscriptionClientReactiveImpl
java.lang.Object
com.graphql_java_generator.client.SubscriptionClientReactiveImpl
- All Implemented Interfaces:
SubscriptionClient
public class SubscriptionClientReactiveImpl extends java.lang.Object implements SubscriptionClient
Default implementation for the
SubscriptionClient
interface.- Author:
- etienne-sf
-
Constructor Summary
Constructors Constructor Description SubscriptionClientReactiveImpl(reactor.core.Disposable disposable, org.springframework.web.reactive.socket.WebSocketSession session)
-
Method Summary
Modifier and Type Method Description org.springframework.web.reactive.socket.WebSocketSession
getSession()
Allow to retrieve theWebSocketSession
, when the implementation is based on Spring Reactive, which is the default since release 1.12void
unsubscribe()
Allows the client application to unsubscribe from a previously subscribed subscription.
-
Constructor Details
-
SubscriptionClientReactiveImpl
public SubscriptionClientReactiveImpl(reactor.core.Disposable disposable, org.springframework.web.reactive.socket.WebSocketSession session)- Parameters:
disposable
- TheDisposable
That allows to close the underlyingFlux
, that receive the subscription notificationssession
- The connectedWebSocketSession
-
-
Method Details
-
unsubscribe
Description copied from interface:SubscriptionClient
Allows the client application to unsubscribe from a previously subscribed subscription. No more notification will be sent for this subscription.
This will free resources on both the client and the server.- Specified by:
unsubscribe
in interfaceSubscriptionClient
- Throws:
GraphQLRequestExecutionException
-
getSession
public org.springframework.web.reactive.socket.WebSocketSession getSession()Description copied from interface:SubscriptionClient
Allow to retrieve theWebSocketSession
, when the implementation is based on Spring Reactive, which is the default since release 1.12- Specified by:
getSession
in interfaceSubscriptionClient
- Returns:
- The
WebSocketSession
, if the Spring reactive implementation is used. Or null otherwise
-