Class GraphQLSubscription
java.lang.Object
com.codename1.io.graphql.GraphQLSubscription
Handle for a live GraphQL subscription. Implements the
graphql-transport-ws message protocol over
WebSocket (introduced in core alongside this
package): connection_init -> connection_ack -> subscribe,
then a stream of next payloads terminated by complete or
error.
Each next payload's data object is mapped to T and delivered
to
invalid reference
Handler#onNext(Object)
the Codename One EDT (matching the OnComplete semantics the query
and mutation paths use), even though the underlying WebSocket fires
on a background thread.
The connection offers the graphql-transport-ws subprotocol during
the WebSocket handshake (RFC 6455 Sec-WebSocket-Protocol), as the
graphql-ws specification requires.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReceives the events of one subscription. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the subscription: sends acompleteto the server and closes the socket.
-
Method Details
-
cancel
public void cancel()Cancels the subscription: sends acompleteto the server and closes the socket. Idempotent; safe to call from any thread.
-