HWebUI-0.1.0.0: Haskell User Interface Library

Safe HaskellNone

Messaging

Contents

Description

Messaging is an internal implementation module of HWebUI. HWebUI is providing FRP-based GUI functionality for Haskell by utilizing the Web-Browser. See module HWebUI for main documentation.

Synopsis

Data Types, used for messages and message buffers

type GUIElementId = String

String identifying a GUI element

data GUIMessage

A GUI message, used to communicate between Browser and Haskell server

Constructors

GUIMessage 

Fields

gmId :: GUIElementId

the unique id of the GUI element

gmSignal :: GUISignal

the signal sent by this message, either a command towards the GUI element or an Event coming from it

gmValue :: GUIValue

the value associated with the command or event

gmType :: GUIElementType

the type of the GUI element

Instances

Show GUIMessage 
ToJSON GUIMessage 
FromJSON GUIMessage 

data GSChannel

A two sided message buffer structure

Functions to handle messages and message buffers

createChannel :: IO GSChannel

creates a message buffer (Channel) with two way communication

receiveGMReadChannel :: GSChannel -> IO (Maybe GUIMessage)

read the message buffer (Channel) during reception of a GUI message from the Browser GUI element

receiveGMWriteChannel :: GSChannel -> GUIMessage -> IO ()

write the message buffer (Channel) during reception of a GUI message from the Browser GUI element, this is used by the Server module to provide the received data towards the Channels and the FRP GUI elements.

sendGMWriteChannel :: GSChannel -> GUIMessage -> IO ()

write the message buffer (Channel) during sending of a GUI message towards the Browser GUI element

sendGMReadChannel :: GSChannel -> IO (Maybe GUIMessage)

read the message buffer (Channel) during sending of a GUI message towards the Browser GUI element, this is used by the Server module to pass all messages over the websocket to the Browser.