SubscriptionWsProtocol
class SubscriptionWsProtocol @JvmOverloads constructor( webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener, connectionAcknowledgeTimeoutMs: Long, connectionPayload: suspend () -> Map<String, Any?>? = { null }, frameType: WsFrameType = WsFrameType.Text) : WsProtocol
Content copied to clipboard
A WsProtocol for https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md
Note: This protocol is no longer actively maintained, and GraphQLWsProtocol should be favored instead.
Constructors
Link copied to clipboard
fun SubscriptionWsProtocol( webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener, connectionAcknowledgeTimeoutMs: Long, connectionPayload: suspend () -> Map<String, Any?>? = { null }, frameType: WsFrameType = WsFrameType.Text)
Content copied to clipboard
Types
Link copied to clipboard
class Factory @JvmOverloads constructor( connectionAcknowledgeTimeoutMs: Long, connectionPayload: suspend () -> Map<String, Any?>? = { null }, frameType: WsFrameType = WsFrameType.Text) : WsProtocol.Factory
Content copied to clipboard
A factory for SubscriptionWsProtocol.
Functions
Link copied to clipboard
Closes the connection gracefully. It is expected that a future call to WsProtocol.Listener.networkError is made
Link copied to clipboard
Initializes the connection and suspends until the server acknowledges it.
Link copied to clipboard
Handles a server message and notifies listener appropriately
Link copied to clipboard
open override fun <D : Operation.Data> startOperation(request: ApolloRequest<D>)
Content copied to clipboard
Starts the given operation
Link copied to clipboard
open override fun <D : Operation.Data> stopOperation(request: ApolloRequest<D>)
Content copied to clipboard
Stops the given operation