AppSyncWsProtocol

class AppSyncWsProtocol(connectionAcknowledgeTimeoutMs: Long, connectionPayload: suspend () -> Map<String, Any?>? = { null }, webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener) : WsProtocol

A WsProtocol for https://docs.aws.amazon.com/appsync/latest/devguide/real-time-websocket-client.html

Constructors

Link copied to clipboard
constructor(authorization: Map<String, Any?>, connectionAcknowledgeTimeoutMs: Long, webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener)
constructor(connectionAcknowledgeTimeoutMs: Long, connectionPayload: suspend () -> Map<String, Any?>? = { null }, webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Factory(connectionAcknowledgeTimeoutMs: Long, connectionPayload: suspend () -> Map<String, Any?>? = { null }) : WsProtocol.Factory

Functions

Link copied to clipboard
open fun close()

Closes the connection gracefully. It is expected that a future call to WsProtocol.Listener.networkError is made

Link copied to clipboard
open suspend override fun connectionInit()

Initializes the connection and suspends until the server acknowledges it.

Link copied to clipboard
open override fun handleServerMessage(messageMap: Map<String, Any?>)

Handles a server message and notifies listener appropriately

Link copied to clipboard
open suspend fun run()

Read the WebSocket

Link copied to clipboard
open override fun <D : Operation.Data> startOperation(request: ApolloRequest<D>)

Starts the given operation

Link copied to clipboard
open override fun <D : Operation.Data> stopOperation(request: ApolloRequest<D>)

Stops the given operation