Graph Q L Web Socket Adapter
open class GraphQLWebSocketAdapter(channel: Channel<OperationMessage<*>>, objectMapper: ObjectMapper, dispatcher: CoroutineDispatcher) : WebSocketAdapter, CoroutineScope
Content copied to clipboard
WebSocketAdapter implementation that bridges incoming WebSocket events into a coroutine Channel to be handled by a consumer, and provides access to the remote for sending messages to the client.
Constructors
GraphQLWebSocketAdapter
Link copied to clipboard
fun GraphQLWebSocketAdapter(channel: Channel<OperationMessage<*>>, objectMapper: ObjectMapper, dispatcher: CoroutineDispatcher = Dispatchers.IO)
Content copied to clipboard
Types
Functions
getSession
Link copied to clipboard
isConnected
Link copied to clipboard
isNotConnected
Link copied to clipboard
onWebSocketBinary
Link copied to clipboard
onWebSocketClose
Link copied to clipboard
onWebSocketConnect
Link copied to clipboard
onWebSocketError
Link copied to clipboard
onWebSocketText
Link copied to clipboard
sendMessage
Link copied to clipboard
Convenience method for writing an OperationMessage back to the client in json format Must be called from the Subscriber's observation context
internal fun <T : Any> sendMessage(type: OperationType<T>, id: String?, payload: T? = null)
Content copied to clipboard
Convenience method for writing the components of an OperationMessage back to the client in json format Must be called from the Subscriber's observation context
Properties
channel
Link copied to clipboard
coroutineContext
Link copied to clipboard
objectMapper
Link copied to clipboard
objectWriter
Link copied to clipboard