graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.GraphQL.Transport.WebSocket

Description

This file contains the handlers that are used within websocket server.

This module export three main handlers for the websocket server (onConn, onMessage, onClose), and two helpers for sending messages to the client (sendMsg, sendCloseWithMsg).

NOTE! The handler functions onClose, onMessage, etc. depend for correctness on two properties: - they run with async exceptions masked - they do not race on the same connection

Synopsis

Documentation

sendMsg :: MonadIO m => WSConn -> ServerMsg -> m () Source #

mkCloseWebsocketsOnMetadataChangeAction :: WSServer WSConnData -> WebsocketCloseOnMetadataChangeAction Source #

By default, we close all the websocket connections when the metadata changes. This function is used to create the action that will be run when the metadata changes.