public class GraphQLTransportWSSubprotocolHandler extends Object implements WebSocketSubprotocolHandler
| Constructor and Description |
|---|
GraphQLTransportWSSubprotocolHandler(io.vertx.core.http.WebSocket webSocket,
Integer subscriptionInitializationTimeout,
Runnable onClose) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelMulti(String id)
Cancels an active subscription with the given ID.
|
void |
cancelUni(String id)
Cancels an active single-result operation with the given ID.
|
void |
close()
Called when the websocket should be closed (for example, when the GraphQL client is being closed).
|
io.smallrye.mutiny.Uni<Void> |
ensureInitialized()
This is called to initialize the websocket connection and prepare it for executing operations.
|
String |
executeMulti(javax.json.JsonObject request,
io.smallrye.mutiny.subscription.MultiEmitter<? super String> emitter)
Requests an execution of a subscription operation over the websocket.
|
String |
executeUni(javax.json.JsonObject request,
io.smallrye.mutiny.subscription.UniEmitter<? super String> emitter)
Requests an execution of a single-result operation over the websocket.
|
public io.smallrye.mutiny.Uni<Void> ensureInitialized()
WebSocketSubprotocolHandlerensureInitialized in interface WebSocketSubprotocolHandlerpublic String executeUni(javax.json.JsonObject request, io.smallrye.mutiny.subscription.UniEmitter<? super String> emitter)
WebSocketSubprotocolHandlerexecuteUni in interface WebSocketSubprotocolHandlerrequest - Request in full JSON format describing the operation to be executed.emitter - Emitter that should receive the completion event (or an error) when the operation finishes.public String executeMulti(javax.json.JsonObject request, io.smallrye.mutiny.subscription.MultiEmitter<? super String> emitter)
WebSocketSubprotocolHandlerexecuteMulti in interface WebSocketSubprotocolHandlerrequest - Request in full JSON format describing the operation to be executed.emitter - Emitter that should receive the completion events (or an error) from the subscription.public void cancelUni(String id)
WebSocketSubprotocolHandlercancelUni in interface WebSocketSubprotocolHandlerid - ID of the operation (returned from calling `executeUni`)public void cancelMulti(String id)
WebSocketSubprotocolHandlercancelMulti in interface WebSocketSubprotocolHandlerid - ID of the operation (returned from calling `executeMulti`)public void close()
WebSocketSubprotocolHandlerclose in interface WebSocketSubprotocolHandlerCopyright © 2018–2022. All rights reserved.